Flow Control

Firmware/software/electronics/mechanics
Post Reply
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Flow Control

Post by Slaxx »

I start a new thread considering flow control as it might help other users to find it as well.
As I see it, the flow control is done in software, since the USART6 has no CTS port on the LQFP64 package. However, there is a port used for NRF_FLOW_CTRL. In the explanation of the protocol you mention that whenever a radio raw package is received, the STM32 can send one. So now there are 2 flow controls? Or is the NRF_FLOW_CTRL not used at all?

I checked the packages that are received by the STM32 and what I get are 2 different radio raw packages (I connected with the Bitcraze Client and a gamepad)
Type: Radio 0x04
Length: 1bytes
Data: 0x20
Type: Radio 0x00
Length: 15bytes
Data: 0x 3c 00 00 00 00 00 00 70 ba 00 00 00 00 00 00
As I found out the first one is a RSSI package. However, this values should be between 0x28 and 0x64.
So if the NRF is not sending any further Null packages that means there are enough packages already sent?

I also saw that the Python program is just sending 14bytes (<fffH), but I receive 15bytes. Where does this '3c' come from? What does it mean?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Flow Control

Post by tobias »

As I see it, the flow control is done in software, since the USART6 has no CTS port on the LQFP64 package.
Yes that is correct, would have been nicer to use the CTS of a UART but it wasn't possible when we found out the nRF51 couldn't handle the serial communication all the time, hardware was more or less ready. It is instead handled by using DMA and pausing it when the nRF51 can't receive (think it's when the bluetooth softdevice is running and blocking the interrupts).
I also saw that the Python program is just sending 14bytes (<fffH), but I receive 15bytes. Where does this '3c' come from? What does it mean?
The 0x3C should be part of the CRTP header. The extra byte is because of the type in the syslink layer wrapping the crtp layer.
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Flow Control

Post by Slaxx »

So if the FLOW_CTRL is HIGH, the STM32 can't send?

That means you have two flow controls implemented? One for the Syslink transfer that is controlled using the NRF_FLOW_CTRL line and one for the radiolink which can only send when messages are received?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Flow Control

Post by tobias »

I wouldn't call the nRF51 a flow control, more a property of the radio communication. The shockburst protocol let's you send data back in the ACK packet and that is why it can only send when it receives (the crazyradio will poll the data).
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Flow Control

Post by Slaxx »

Ok. Is there some timing limit for the Crazyradio?
I realized that messages are missed when I sent them back. Maybe I'm to slow.
Post Reply