Skip to main content
baptor
Associate III
February 26, 2018
Solved

nrf24l01 on nucleo F411re

  • February 26, 2018
  • 8 replies
  • 2988 views
Posted on February 26, 2018 at 15:00

Hello everybody, I am new in using nucleo's boards and especially F411re. I 'am trying to interface a nrf24L01 module on this board ( not using mbed ), and for now, I'am still lost into the use of the TM_STM32F4_nrf24l01 lib . I am using sw4stm and I wonder if somebody have a complete eclipse projet that could be opened by sw4stm and be loaded on my nucleo f411re? 

thank a lot

Baptiste.

#nrf24l01 #nucleo-f411 #stm32f4 #sw4stm32
This topic has been closed for replies.
Best answer by Zek_De
Posted on February 26, 2018 at 18:36

Yes ,Tilen Majerle,I used his library and converted as Hal Library.I dont remember If I shared the example.I am gonna look it later

8 replies

Zek_De
Senior
February 26, 2018
Posted on February 26, 2018 at 16:49

Hi,

I have a nrf24l01 library related with stm32 hal library ,I organized it using another library.Maybe it is usefull for you.

https://github.com/ZekDe/Libraries

 
baptor
baptorAuthor
Associate III
February 26, 2018
Posted on February 26, 2018 at 16:58

Thank you for your fast answer, I will try to implement it tonight and see if it work for me.

thanks again, I will keep you updated.

Baptiste

Andrew Neil
Super User
February 26, 2018
Posted on February 26, 2018 at 17:42

You mean this:

https://stm32f4-discovery.net/api/group___t_m___n_r_f24_l01_p.html

?

The author, I believe is

Majerle.Tilen

‌ - maybe he will be along soon ...

I am new in using nucleo's boards and especially F411re

Do you have experience with using other boards and/or microcontrollers?

Do you have experience with programming in general?

I'am stilllost into the use of the TM_STM32F4_nrf24l01 lib

So what have you actually tried so far?

Where are you stuck?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Zek_De
Zek_DeAnswer
Senior
February 26, 2018
Posted on February 26, 2018 at 18:36

Yes ,Tilen Majerle,I used his library and converted as Hal Library.I dont remember If I shared the example.I am gonna look it later

Zek_De
Senior
February 26, 2018
Posted on February 26, 2018 at 18:39

Also İF you use stm32f0 or stm32f1 series ,you can come acroos with an alignment problem .about pointer ,and I fixed it by helps in Hal SPI Library with small changing

baptor
baptorAuthor
Associate III
February 26, 2018
Posted on February 26, 2018 at 20:25

Hi, yes I did use some pic16f84 long time ago, and since some years, I 'am using arduino boards ( high level programming, easy )... Today I have to use Nucleo board with the nrf module. I started by creating a cubemxproject in witch I set spi2 to communicate with nrf. I opened the project with sw4stm32, compiled it, added a LED_2 toggle to see something moving.

My first problem was to understand was was done in thetm_stm32f4_nrf24lc library and how to link it to my main().

Thanks to Emrah, now I have a more simple library that I understand better.

Mynewproblem is, how togive hspi2 to the nrf24Lc library .

I did :

TM_NRF24L01_Init(hspi2, 1, 32);

but I have no signal going out from spi port (I have a scope on MOSI pin ans clk). At less, I should see something moving on the MOSI pin during the Init of the nrf.

I attached my code at the state it is now.

I hope I am clear enough

Thank you

Baptiste

________________

Attachments :

NRF_SPI_simple_noOS_other.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxw5&d=%2Fa%2F0X0000000b2X%2FFltdmDUm_gl2e6G0Or67DFfbEHqbCVViQQOAOIHRXRE&asPdf=false
Tilen MAJERLE
ST Employee
February 26, 2018
Posted on February 26, 2018 at 21:08

Hello

Duatepe.Emrah

‌,

let us know what is the key problem in your development and we will try to help you.

Did you manage to get 'hello world' inside SW4STM32?

I would suggest you to move to TrueSTUDIO.

Best regards,

Tilen

baptor
baptorAuthor
Associate III
February 27, 2018
Posted on February 27, 2018 at 18:03

Hello everybody, I finally came across my problem, first i had the vcc pin of the nrf module that was on the +5V instead of the +3V3. I used mbed website to use a hello world that made me see this problem. I made two nucleo f411re board exchange data via nrf.

Then when I came back on SW4STM32 I did not success to make it work as on mbed.

So I checked all the function in the nrf24L01.c library that Emrah shared. I had two missing function that I recoded to fit my setup :

void

TM_NRF24L01_setCrcWidth(

SPI_HandleTypeDef

*hspi,

uint8_t

width);

void

TM_NRF24L01_disableAutoAcknowledge(

SPI_HandleTypeDef

*hspi);

after that, I successfully exchanged data between boards. here is the SW4STM32 project archive for those that would need a complete project.

Thanks for you help.

Baptiste

baptor
baptorAuthor
Associate III
February 27, 2018
Posted on February 27, 2018 at 18:14

Here is the final project.

baptiste

________________

Attachments :

NRF_SPI_simple_noOS_other 2.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxvk&d=%2Fa%2F0X0000000b2O%2Few_RY_i1cNDy4KxsW1bMp11d8U0m1CvYIWKI.qZ1l4E&asPdf=false
jean-christophe Toussaint
Associate III
May 21, 2018
Posted on May 21, 2018 at 12:14

Dear Baptiste

Thank you for your contribution. 

It seems that you used the same main code for the transmitter and the receiver.

Have you checked that the receiver recovers all the data sent by the transmitter

by doing a byte to byte comparison?

Bye

JC