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

undefined reference to `__nop' #4

Open
MarkEvens opened this issue Aug 18, 2023 · 3 comments
Open

undefined reference to `__nop' #4

MarkEvens opened this issue Aug 18, 2023 · 3 comments

Comments

@MarkEvens
Copy link

in function hx711_delay_us': undefined reference to __nop'

I have put this lib in stm32 project Drivers folder and given path properly

Having this issue can guide me on what I am doing wrong

@Gocql022
Copy link

My English no so good, please translate the following text, I think it may help you(Chinese to English).
undefined reference to __nop'意味着没有定义__nop()函数,我今天也遇到了这个问题,去网上查了下这个函数的含义,得知这是一个什么都不做只会延时(时间极其短暂)的函数,因此只需在引用了__nop()的文件上面如此定义这个函数:
void __nop()
{
;
}
这样一个__nop()函数就定义好了,希望能帮到你😊

@M-S-10
Copy link

M-S-10 commented Nov 1, 2024

__NOP() with an undefined reference is due to a missing header file.

  • The __NOP() function is defined in the CMSIS (Cortex Microcontroller Software Interface Standard) library, specifically in core_cm4.h for Cortex-M4

  • Typically, including stm32f4xx.h should work for STM32F4 series

  • f the CMSIS library is properly included, the __NOP() macro should work without additional configuration

  • As a last resort, you can use inline assembly if __NOP() is unavailable: __asm("NOP");

@M-S-10
Copy link

M-S-10 commented Nov 2, 2024

@nimaltd You may close this issue. Thanks

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

3 participants