2013-03-25 02:39 AM
Hi,
We are trying to migrate from IAR Kickstart kit with IAR-STM32F207ZG-SK board to our own board.
On our PCB we have STM32F207ZC mounted.
The small test code is successfully downloaded with J-Link.
Downloaded C:\data\p-1026-lockkort-pwm10\arm\examples\ST\STM32F2xx\STM32F2xx_StdPeriph_Lib\Project\STM32F2xx_StdPeriph_Examples\TIM\TIM10_PWMOutput\STM322xG_EVAL\Exe\TIM10_PWMOutput.out to flash memory.
But we get this warning:
Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF
We have changed to the device we use in IAR pre-processor settings.
Probably there is still a file somewhere that describe device used as STM32F207ZG
and set stack pointer to a non-existing SRAM address.
The downloaded program do not run.
Any suggestions where to look for and change device settings?
/Richard
2013-03-25 04:27 AM
Looks more like it's not programming flash, or the right area at the beginning. You should definitely look over the .MAP file to see where things are situated.
Not a big IAR guy, but I'd imaging there is a CPU Target selection under the options, but this should only alter the size of memory regions, not the start address. Check the debug/flash algorithm settings. Check the flash memory with something like JMem to confirm your app downloaded at 0x08000000. Check what you're doing with the BOOTx pins.2013-03-25 06:51 AM
Hi clive1,
MAP file seem to have correct values:*** PLACEMENT SUMMARY
***''A1'': place at 0x08000000 { ro section .intvec };
''P1'': place in [from 0x08000000 to 0x080fffff] { ro }; ''P2'': place in [from 0x20000000 to 0x20020000] { rw, block CSTACK, block HEAP };Section Kind Address Size Object
------- ---- ------- ---- ------ ''A1'': 0x184 .intvec ro code 0x08000000 0x184 startup_stm32f2xx.o [1] - 0x08000184 0x184 We have changed to the device we're using inside IAR options and J-Link seem to get it right during download:Device ''STM32F207ZC'' selected (256 KB flash, 64 KB RAM).
J-Link seem to use correct bootloader and debugger algoritm:lö mar 23, 2013 15:40:59: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5\arm\config\flashloader\ST\FlashSTM32F205xC.out
lö mar 23, 2013 15:40:59: Target reset
lö mar 23, 2013 15:40:59: Downloaded C:\data\p-1026-lockkort-pwm10\arm\examples\ST\STM32F2xx\STM32F2xx_StdPeriph_Lib\Project\STM32F2xx_StdPeriph_Examples\TIM\TIM10_PWMOutput\STM322xG_EVAL\Exe\TIM10_PWMOutput.out to flash memory.
lö mar 23, 2013 15:40:59: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5\arm\config\debugger\ST\Trace_STM32F2xx.dmac
lö mar 23, 2013 15:40:59: Hardware reset with strategy 0 was performed
lö mar 23, 2013 15:40:59: 3308 bytes downloaded into FLASH (10.91 Kbytes/sec)
lö mar 23, 2013 15:40:59: Loaded debugee: C:\data\p-1026-lockkort-pwm10\arm\examples\ST\STM32F2xx\STM32F2xx_StdPeriph_Lib\Project\STM32F2xx_StdPeriph_Examples\TIM\TIM10_PWMOutput\STM322xG_EVAL\Exe\TIM10_PWMOutput.out
lö mar 23, 2013 15:40:59: Hardware reset with strategy 0 was performed
lö mar 23, 2013 15:41:03: Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF
lö mar 23, 2013 15:41:03: Target reset
lö mar 23, 2013 15:41:04: There was 1 warning during the initialization of the debugging session.
BOOT pins are set to download from flash (same setting on EVAL board works). STM32 processors are new territory for us, I got an inkling that somewhere inside a file wrong values are passed. Tried to search with no luck... /Richard2013-03-25 09:52 AM
Use the JMem utility, check the memory content at 0x08000000 and 0x00000000
Your .MAP still reflects FLASH 1MB, RAM 128KB, although honestly it's the same die as the one you're using.2013-03-25 08:02 PM
2013-03-26 11:32 AM
I'm clueless.
But also quite happy... Did some more code development on Kickstart eval board. I.e got USART3 up and running finally. Thanks Clive1 for giving a code example in another thread. Made me realize that the example code was missing essential stuff. Decided to get back to our own board and maybe try to see what JMem could offer to solve the problem. Connected the board to J-Link and downloaded the new code, expecting same warning about Stack address. But no, it just worked!! Thanks everyone trying to help, hopefully this subject is solved now and I can concentrate on developing code. What caused it in first place remains a mystery... /Richard2013-03-26 12:40 PM
The suggestion with JMem would do two things, it would confirm that the device was being flashed with code, and secondly indicate what is mapped at zero, ie FLASH, RAM or ROM.
2014-01-15 08:22 PM
In 'project settings', 'Debugger, 'download' page, select the 'use flash loader(s)' checkbox...
2014-10-06 02:16 AM
For me this one worked :
Go to -- ''Options->Debugger->Download'' . Select 'Use flash loader(s)'. Every time I faced this Warning Message ''.....stack addr = 0xFFFF...''. I have observed that this option gets automatically unchecked. This seems to be some bug with IAR development environment. I hope this works for you as well2014-10-06 03:09 AM