cancel
Showing results for 
Search instead for 
Did you mean: 

X-NUCLEO-IDB05A1 BLE shield with the STM32F103 Nucleo board in mbed

Nicholas Yunker
Associate II
Posted on April 05, 2017 at 16:28

Hello everyone, I am attempting to use an X-NUCLEO-IDB05A1 BLE shield with the STM32F103 Nucleo board in the mbed online IDE. Every time i add the X_NUCLEO_IDB0XA1 library to my project it will compile with no problem but when I load it onto my F103 Nucleo board it stops all my previously working code from working.  I haven't even added any calls or include statements for this library; I am just loading the library into my program tree and compiling.  Adding the BLE_API library works fine it's when I add the shield library after it that it causes the issue.  Can anybody help?

Just for reference I am using the TCS3472_I2C library as well to control the TCS3472 color sensor.  Using this library to pull color data from the sensor and print that to my PC serial port works perfectly until I add the X_NUCLEO_IDB0XA1 library.  Once I do that, the data stops outputting to the serial port.

None of the pre-written programs using the BLE shield seem to work either when I load them onto the F103 Nucleo board.  According to Mbed's list of supported Nucleo boards for the Shield the F103 is supported so I don't see how this could be the issue.

#x_nucleo_idb0xa1 #ble #spbtle-rf #nucleo-f103rb #x-nucleo-idb05a1
2 REPLIES 2
Nicholas Yunker
Associate II
Posted on April 05, 2017 at 17:24

Also, I have hooked up an oscilloscope to the SPI traces that the BLE shield uses and when I load the code with the X_NUCLEO_IDB0XA1 library all the outputs 'go crazy'.  All the signals get very spiky and some signals seem to dissappear all together from the screen.  Reverting back to the code without the X_NUCLEO_IDB0XA1 library and the signals go back to normal.

Nicholas Yunker
Associate II
Posted on April 06, 2017 at 13:21

I figured out the problem I was having.  I can not track down WHY the NUCLEO-F103RB eval kit has this issue (along with NUCLEO-F302R8, NUCLEO-F411RE and NUCLEO-F446RE) just that it has an issue with using the SPI Clock on the default pin D3 (PB_3).  There is a hardware patch that must be made, which I knew about and originally tried, and a software patch to go with it, which I did not know about.  The documentation on this is a little sketchy so here is what I did:

1) Remove the 0ohm resistor from R4 on the BLE shield

2) Place a 0ohm resistor on R6 on the BLE shield

3) In the X_NUCLEO_IDB0XA1 library in mbed you must drill down until you find the x_nucleo_idb0xa1_targets.h header file.  open that file and add one line of code after the comment block that talks about a patch macro for D13 and the SPI clock.  Immediately after this comment block add a single line of code that read:

#define IDB0XA1_D13_PATCH

THIS MUST COME AFTER THE COMMENT BLOCK BUT BEFORE THE #IF DEFINED STATEMENT.

It seems like the person who last updated the code only partially patched the code to give it the ability to decide if you wanted to change the clock signal to a different pin but then relied on the coder to realize they had to add an entire define statement without being prompted to do so.  It would almost have been easier to change the warning in MBED to not only tell you you needed the hardware patch and to also just change the one define statement from D3 to D13.

anyway, it works, and I hope this thread helps anybody else who is having these issues.