- Mon Jul 01, 2013 9:03 am
#161119
I'm attempting to test out some basic programs on an STM32L151RD (Cortex-M3) using IAR's Embedded Workbench. I'm using an ST-LINK/V2 programmer. I've downloaded the Standard Peripherals Library and generally have been able to get it working, with one exception. For some reason, if I use the provided startup file "startup_stm32l1xx_hd.s" the MCU just hangs when I load the program, and I end up having to use the ST-LINK Utility software to reset the MCU.
At first I thought the solution was to just not use the startup file, figuring that IAR must've included it (or something equivalent) automatically elsewhere since it compiles, loads, and runs just fine without it. That was fine until I needed to use an interrupt handler for a simple SysTick program, and of course since all of the interrupt handlers are supposed to be defined in the startup file (as I understand it), SysTick doesn't work.
Just to clarify, by "include" the startup file, I just added it to the project source like I would a .c file. If there's some other project setting I need to point to the startup file, I haven't found it.
I've looked over the list of all the files I need to include and compared against the template project, so far as I can tell I'm doing everything right. I'm new to both ARM and IAR, if anyone has any simple things I should check or any feedback on what might be wrong I'd greatly appreciate it.
At first I thought the solution was to just not use the startup file, figuring that IAR must've included it (or something equivalent) automatically elsewhere since it compiles, loads, and runs just fine without it. That was fine until I needed to use an interrupt handler for a simple SysTick program, and of course since all of the interrupt handlers are supposed to be defined in the startup file (as I understand it), SysTick doesn't work.
Just to clarify, by "include" the startup file, I just added it to the project source like I would a .c file. If there's some other project setting I need to point to the startup file, I haven't found it.
I've looked over the list of all the files I need to include and compared against the template project, so far as I can tell I'm doing everything right. I'm new to both ARM and IAR, if anyone has any simple things I should check or any feedback on what might be wrong I'd greatly appreciate it.