IAR远程Debug是出现:warning:stack pointer is setup to incorrect alignment.

本文介绍了解决STM32芯片在编译时遇到的读保护问题的方法。当STM32设备被设置为读保护状态时,闪存中的数据会显示为0xAA。此时若启动Cortex-M设备并尝试读取0x00到0x03地址的数据作为堆栈指针的值,则可能会遇到无效值0xAAAAAAAA。解决这个问题的方法是使用外部工具如JLinkSTM32.exe来擦除STM32闪存。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在编译的时候出现的问题,很是有点郁闷!!
查阅后,显示如下:
background:
The STM32 device can be read protected.
When that is done will the bytes in the flash memory read out as 0xAA.
When the Cortex-M device starts up are the bytes 0x00 to 0x03 read as holding the value of the stack pointer, and in that situation is the value 0xAAAAAAAA invalid.


Solution:
The flash of the STM32 needs to be erased with an external tool.
The tool arm\bin\JLinkSTM32.exe can do this erasure. (Just run the tool from command line.)


或许你上面没有看懂,或许你看懂了!!!
下面我说一下自己及巨额的办法:
此种情况,很多是由于芯片的一个保护功能,就是说在你仿真的时候,你原来的芯片里面已经有程序了,在你想要重新搞定之前,你需要先擦除芯片里面的程序!!!
英文部分提供了一个很好的办法,就是打开IAR的按章文件的此路径(arm\bin\JLinkSTM32.exe)下的JLinkSTM32.exe这个家伙即可,你点击以后根据提示或者体会自动那个擦出你芯片里面的程序!SO!恭喜,你的芯片又可以Debug了.................
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值