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

FAL 组件里面的 device_table 和 device_table_len 用 const 声明编译器可能会分配 0 地址 #305

Open
FixJA opened this issue Jul 19, 2024 · 2 comments

Comments

@FixJA
Copy link

FixJA commented Jul 19, 2024

在 fal_flash.c 文件中
image
使用 const 声明在 nxp 环境 gcc 编译器可能会分配 0 地址
image

把 const 修饰去掉之后,分配的地址就正常了

@armink
Copy link
Owner

armink commented Jul 20, 2024

什么原因呢

@FixJA
Copy link
Author

FixJA commented Jul 22, 2024

我简单测试了一下,发现只要用到 const 声明的变量,编译器分配的 roata 段都是从 0 地址开始的,还不知道为什么会这样

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