Using SPI with callback on STM32F103

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
User avatar
z80
Posts: 20
Joined: Mon Oct 08, 2012 5:36 pm

Using SPI with callback on STM32F103

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Using SPI with callback on STM32F103

Post 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
User avatar
z80
Posts: 20
Joined: Mon Oct 08, 2012 5:36 pm

Re: Using SPI with callback on STM32F103

Post 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.
Post Reply