Giter Site home page Giter Site logo

nrf24l01 about stm32 HOT 17 CLOSED

lonelywolf avatar lonelywolf commented on August 17, 2024
nrf24l01

from stm32.

Comments (17)

LonelyWolf avatar LonelyWolf commented on August 17, 2024 1

When you got MAX_RT bit set after transmit, this means what the nRF24 did not received an ACK packet from the receiver side.
The reasons can be: poor reception, incorrectly configured receiver, etc.
As for receiver configuration: if you use the auto acknowledgement, then you must properly configure the PIPE#0 on the receiver side (address of the transmitter for auto ack, transmit power).

And this "library" (if you use the one from the "Nrf24l01" directory in that repo) is very old and contains some nasty errors. Didn't remember all of them, but the royal one is that the address is programmed in reverse order, e.g. if you program it as "12345", then actually in the nRF24 it will be "54321" and if your receiver side is configured by other soft (what programs the address correctly), nothing will work.

In the "stm32l151rdt6-dev" directory present more recent nrf24.c, but I don't like it too. I have more decent "library" for nRF24, but I've not uploaded it to github yet. It needs an usage example, but right now I don't have free time for it.

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024 1

I've re-uploaded the nRF24 project with new library and some stupid demo code (TX and RX). Look at it, maybe it will be useful. I've especially got my old good F103 boards and write a demo code using SPL...

I've tried to write this library 'hardware-independent', with purpose of moving to other platform with minimal code changes. So far it worked on STM32L151, STM32L476, STM32F103, STM8L151 and Raspberry Pi3 (not by me)...
On the STM32 I can note one issue: when your CPU is really fast and the SPI speed is really slow, the code can fail due to early CSN pin de-assertion (while the SPI clock didn't finished last bit transmission). Maybe the CSN pin handling should be removed from nRF24 code... maybe other solution... I don't know yet. Arghhh... my pidgin english, I can't describe that issue properly :)

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024 1

On the receiver part, have you set a correct transmit power level? Because default it is at the lowest value. Imagine situation: your TX part transmits at 0dBm (yelling), the RX part receives the packet, automatically switches to TX mode and replies with ACK packet at the -18dBm (whispers). As a result your transmitter did not hears the answer and retransmits the packet...

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024 1

And one more thing comes to mind: on the receiver side, have you configured address for pipe#0 same as address on the TX side? The ShockBurst retransmits ACK packets using address of pipe#0.

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024 1

I've played with ShockBurst, added a couple of functions for better handling of that feature. All working. Look at examples, if it doesn't help - RTFM (really, read datasheet, it written pretty good).

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024 1

I'm not familiar with C++ and not shure what you want to do, but if it will be something usefull... it will be great. Let's see :)

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

it contains a lots of errors in transmit methods , i try to fix it but still has errors could you please upload the other lib you have ?

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

it's great thank you , i'm going to test it.

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

it works , but when I want to test it with Auto-ACK mode enable the receiver only received once and the transmitter got [1E] MAX RETRANSMIT ! why ? i just comment //nRF24_DisableAA(); in DEMO_TX_SINGLE section and comment nRF24_DisableAA(); and set nRF24_SetRXPipe to nRF24_AA_ON in DEMO_RX_SINGLE section ! do I need change something else to enable Auto-ACK in tx and rx single mode ?

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

I added nRF24_SetTXPower(nRF24_TXPWR_0dBm); to receiver section but it doesn't affect , however the transmitter and receiver are very close , I think there is a issue in the code ?

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024

LOL, how can I say why it isn't working when I didn't see of your code neither hardware...
Later I will try ShockBurst on my hardware...
But take a little advice: forget about ShockBurst, it's pretty useless, slow and greedy for the power.

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

about code I use exactly your sample code , and about hardware I use simple STM32F103RET6 training board just to test NRF module and about ShockBurst I just want to use Auto-ACK mode to ensure the success of transmission .

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

Thank you for this ;) I really appreciate

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

Ok

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024

Looks good, but I'm not familiar with the C++, so can't judge about it :)
So... what I've supposed to do?

from stm32.

LonelyWolf avatar LonelyWolf commented on August 17, 2024

No, I don't want to share my contacts :)

from stm32.

hamed-ta avatar hamed-ta commented on August 17, 2024

Ok , thank you ;)

from stm32.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.