Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'__NOP' was not declared in this scope #153

Open
epikao opened this issue Oct 19, 2021 · 1 comment
Open

'__NOP' was not declared in this scope #153

epikao opened this issue Oct 19, 2021 · 1 comment

Comments

@epikao
Copy link

epikao commented Oct 19, 2021

Hello, I'm using Bluepill STM32F103C8, with stm32duino (arduino framework) and platformio.
I try to compile a simple Hello world program, but I have following error:

.pio\libdeps\genericSTM32F103C8\Ucglib\src\Ucglib.cpp: In function 'void ucg_com_arduino_send_8bit(ucg_t*, uint8_t)':
.pio\libdeps\genericSTM32F103C8\Ucglib\src\Ucglib.cpp:834:3: error: '__NOP' was not declared in this scope

I use:
Ucglib_ST7735_18x128x160_HWSPI ucg(/*cd=*/ PA8, /*cs=*/ PB12, /*reset=*/ PA15);

Is this library still up to date? I think this library looks good and could be useful (lightweight) for controller with limited flash (64kB).

Thank you

@21347
Copy link

21347 commented May 30, 2022

This is because the __NOP intrinsic is missing in the toolchain pulled for the STM32 in this case. I don't remember exactly when and why that was changed (If memory serves me well, the toolchain needs an update of the compiler, I think it was moved from library to compiler level some time ago, but I can be wrong here...)

As s quick fix, add

#if defined(__arm__)
#define __NOP __asm volatile ("nop")
#endif

at the beginning of Ucglib.cpp. I don't know if this is the best solution, maybe something like #if defined (__NOP) is better, but depending on the project, the above might be sufficient.

Update: there's already a pull request for his from someone else, I didn't notice: #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants