Skip to main content
vito
Associate
March 26, 2015
Question

STM32: how to use an nrf24l01 transceiver

  • March 26, 2015
  • 12 replies
  • 5862 views
Posted on March 26, 2015 at 07:20

Hi to all,

I have two stm32f3 discovery with 1 nrf24L01 transceiver on each one.  I want to send a packet from one and receive this packet on the other one. Can someone help me? I have no idea. Thanks...
    This topic has been closed for replies.

    12 replies

    gvigelet
    Associate III
    March 26, 2015
    Posted on March 26, 2015 at 15:54

    Hi, 

    Here is a resource that should help you out, basically you just need to make a SPI connection to the module and issue commands for configuring the module and transmitting and receiving.  I believe the resource provides an implementation for SPI and GPIO implementations.

    http://stm32f4-discovery.com/2014/06/library-17-nrf24l01-stm32f4xx/

    Thanks,

    George 

    vito
    vitoAuthor
    Associate
    March 27, 2015
    Posted on March 27, 2015 at 21:59

    it seems good thanks...

    i think i have to change that code to make it campatible with F3, since it is originally for F4. Can you help me on that?

    I think i have to change the pins, stuff about alternate function...what else?

    thanks again

    gvigelet
    Associate III
    March 30, 2015
    Posted on March 30, 2015 at 16:28

    The quickest way to get up in running is to use the Cube middleware, I would suggest using the gpio implementation library that is on that page to get you up and running then migrate the to the SPI version if needed.  To migrate the code, you should be able to get away with the .c file as is and change the includes on the .h file to refelect the stm32 f3

    #include ''stm32f3xx.h''

    #include ''stm32f3xx_gpio.h''

    Then in your defines.h set up the pins you configured in stm32cube for GPIO and you should be up in running.

    Thanks

    vito
    vitoAuthor
    Associate
    April 4, 2015
    Posted on April 04, 2015 at 21:54

    I'm using IAR at the moment. isn't it good enough?

    Anyway, i tried the code above, getting the missing library from

    https://github.com/MaJerle/stm32f429

    Some libraries include only .h file, and then call functions defined in the .c file (not included) rather than the included .h with same name. Another library include himself. It seems bad code...

    Tesla DeLorean
    Guru
    April 4, 2015
    Posted on April 04, 2015 at 23:15

    I'm using IAR at the moment. isn't it good enough?

    I'd imagine it's just fine. You might however just want to use the F3 standard peripheral library, and review the SPI support there.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    vitto4ever
    Visitor II
    October 2, 2015
    Posted on October 02, 2015 at 11:23

    hi, have you resolved your problem? if yes, can you help me? I have the same problem and I don't know what I have to do.

    Amel NASRI
    Technical Moderator
    October 7, 2015
    Posted on October 07, 2015 at 15:54

    Hi squa.paul,

    It should be better to initiate a new discussion in which you describe precisely your problem and in which environment (HW/FW...).

    -Mayla-

    To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
    vitto4ever
    Visitor II
    October 9, 2015
    Posted on October 09, 2015 at 17:40

    I didn't initiate a new discussion becouse I saw this post from arci.vito that has the same problem I have, with the same HW. 

    Tesla DeLorean
    Guru
    October 9, 2015
    Posted on October 09, 2015 at 18:13

    So you have two STM32F3-DISCO, with NRF24L01, IAR tools, and no idea what you're doing?

    The problem with these types of question is that they're chronically open ended. I think you're going to have to read the related documentation, and look at implementation examples on this, and other, platforms to get a sense of what's required. When you have a specific question about a particular facet of the problem, or why a particular piece of code isn't working, frame it as such.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    tm3341
    Associate III
    October 11, 2015
    Posted on October 11, 2015 at 13:48

    I really wanna know, what part of code is BAD here and where I don't include files properly?

    In C, .h files are included and there are also function declarations for ''public'' functions.

    .c file is here to implement this functions as ONLY .c files are compiled!

    So please, explain that to me, why this code is bad!