cancel
Showing results for 
Search instead for 
Did you mean: 

Help getting ISR callback for timer?

skeezix
Associate II
Posted on January 14, 2014 at 22:24

I'm quite likely missing something obvious to someone, but so far this is eluding me :)

I've got an STM32F205RE by itself on a breadboard (no eval or discovery board here.) I'm using libopencm3 for linker-script and some sample code, and using the https://launchpad.net/gcc-arm-embedded toolchain, along with openocd for flashing. Linux based environment. I've added external 8mhz crystal and associated caps to ground, and using the libopencm3 go-to-120MHz function, but nothing else on the board.

Code in question is quite short, here:

http://pastebin.com/xTxn5829

Essentially a blinking light hello world app, but goal being to toggle the LED in an ISR callback from the timer. I have a variation of that code that polls the timer and works fine .. so I know I can build code and deploy it okay in general, but this particular version isn't working.

I suspect something out of the code (so the vector table is goofy, and my ISR function is not being seen at all?), or perhaps I'm just missing a register assignment somewhere. I'm new to STM32 world so trying to get my head around the documentation and so on .. if you spot anything, let me know :)

I'm using linkerscript as from libopencm3-examples, though modified to have the right ROM and RAM size for my chip (since there is onyl 1 sample for the F2 chip).

In case its a deployment issue, I'm deploying like this:

openocd -f interface/stlink-v2.cfg \

                    -f target/stm32f2x_stlink.cfg \                                                                                                                                         -c ''init'' -c ''reset init'' \

                    -c ''stm32f2x mass_erase 0'' \

                    -c ''flash write_image miniblink.hex'' \

                    -c ''reset'' \

                    -c ''shutdown'' $(NULL)

I flash the code, hit reset on the chip (pull it to ground for a moment), and then led just stays on. I've not hooked up any debugger yet (next thing to figure out), so I'm not sure if its crashed or hanging on blocked interupts or what.

Thank you for any help, and for your patience in reading,

jeff
11 REPLIES 11
Posted on January 15, 2014 at 17:39

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Problem%20with%20DMA-USART%20Rx%20on%20STM32F407VG&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=148]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FProblem%20with%20DMA-USART%20Rx%20on%20STM32F407VG&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=148

The NOP is not particularly effective at fencing memory operations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
skeezix
Associate II
Posted on January 15, 2014 at 17:45

It does seem like I'm receiving an extra interupt handler invocation, so that is probably it. Weird, but okay, I get it now.. good to know, that you have to do somethign a little meatier or it'll act funny.

Thanks again clive!