Page 1 of 1

Using SPI with callback on STM32F103

Posted: Tue Aug 11, 2015 2:13 am
by z80
Hello,

My microcontroller is STM32F103CBT6. I have the following problem. I can't make SPI work with callback. I took "testhal\STM32F1xx\SPI" example and replaced NULL in configuration structure with my callback and replaced spiExchange() with spiStartReceive() routine with no result. Is there anything else I should change in order to use callback?

I tried stable_2.4.x and stable_2.6.x head Chibios versions from GitHub repository. I can't check it in stable_3.0.x because due to some reason debugger doesn't see source code for the resulting ELF file. So I can't debug it. Options string I used is the following: "USE_OPT = -O0 -g -ggdb -fomit-frame-pointer -falign-functions=16". For 2.4.x and 2.6.x it worked well.

I would appreciate any advice very much!

Re: Using SPI with callback on STM32F103

Posted: Tue Aug 11, 2015 7:10 am
by Giovanni
Hi,

It should work or the driver would not work at all even without callbacks.

Are you using ChibiStudio or some other toolchain? I have no trouble debugging 3.0.

Giovanni

Re: Using SPI with callback on STM32F103

Posted: Wed Aug 12, 2015 1:09 am
by z80
I'm sorry, it seems to me I've found the problem. That's pure IDE problem. Due to some reason breakpoint in callback routine doesn't trigger. I changed it to LED toggling. And I see it's blinking.