Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial: Tx use FIFO plus fixes #90

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KurtE
Copy link
Contributor

@KurtE KurtE commented Aug 7, 2023

NOTE:
I started this as a draft PR as it is a reasonably complex change. Difficult to split into smaller simpler changes, as for example simply fixing the method: write to have the const ... Will end up causing data to be lost.

I am still testing different test sketches, The last run I did was to test USB To Serial sketch that I have setup as a loop back (tie the RX to TX pin). Worked fine for both MINIMA and WIFI on either Serial1 or the Serial object that you can create on SCL/SDA pins which uses FIFO.

Thought it would be good to give everyone a heads up, to see if anyone has some preliminary comments.


Resolves: #44

This is a reasonably major update to the Serial(UART) code base, which is mostly concentrated on the Output(TX) side of it.

Simple part of the description:
The currently released code, did not use the FIFO object that was built into the Serial object. Instead it would output one character at a time and then wait for a callback from the lower level code base, which could be TDRE or TEND (mostly likely TDRE) before it would return from the call. There were several other methods that did not work or were not implemented including: flush(), availableForWrite().

Also the write with buffer and count did not work as it did not have the same parameters as the one in the Print class, so the print class simply enumerated each byte.

More Complex stuff:
Write Call
I added a 16 byte buffer to the UART class that I use to pass down to the R_SCI_UART_Write calls, with as much data as I have up to 16 from the write method if a write is not currently in process. If not active and the FIFO is empty. I detect that and bypass using FIFO up to the first 16 characters. If write is active, the new data is added to the FIFO.

UART_EVENT_TX_DATA_EMPTY
Note: I mention TDRE here, but also cases for FIFO which are different. When lower level completes the write, it will do a callback with the event: UART_EVENT_TX_DATA_EMPTY. First try was to simply grab what is available up to 16 bytes and recall R_SCI_UART_Write with that. But that can lose data, as the callback is called when the ISR code has put the last byte into the TDR register, and the Write call always tries to put the first character out, which if the TDRE state is not set, will lose the last byte. Found I needed to handle two cases:

  1. If TDRE I call the write function again.
  2. if not TDRE, I update the Buffer/count member variables and reset which interrupt events which will happen.

TIMING
I was still running into conditions where either data was lost or the transfers did not work correctly.

RingBuffer:
Found in several cases we were spending too much time in the ISR and we could lose interrupts on either UARTS or the same UARTS but different Interrupt. Found a lot of the time was spent in the SafeRingBufferN code, where it creates a class object which disables all interrupts and maybe reenables them at the end. This is needed as the API/ RingBufferN code is inherently unsafe to use here. I created my own versions of these classes that make the RingBuffer class safer such that the Safe version could be a minimal subset. That decreased the overhead a lot.

FIFO Size:
When using one of the UARTS with FIFO, we filled the RX before any was returned. So the ISR might need to process 16 characters, which took a while. I have it currently set to 8. I updated all of the Variants to allow each to set their preference.

Interrupt Priority:
I setup to Interrupt code to allow us to set a different priority for the RX ISR versus the TX ISR. As if a TX ISR is delayed it
simply could mean we delay when the next characters output. However, if we an RX interrupt is delayed, and this
is a double buffer port like Serial1 and Serial on WIFI, then if it is delayed the amount of time it takes to receive the next
character, a character will be lost with the overflow condition set. I have the RX now set at a higher priority (lower value)

RX
As mentioned above, when we receive bytes and the ISR is triggered, it calls our callback with the UART_EVENT_RX_CHAR event. For simple double buffer UARTS, we simply store one character away.

However for FIFO UARTS, it will callback to us one time for each character in the FIFO. Which
before took a lot of time. As for character it would setup the callback, call it, where we
disabled the interrupts...

The new cod instead extracts the remaining characters from the FIFO and stuffs them directly back into our fifo queue.

To keep from having to look each time at, am I running on a FIFO queue or not, I have two
different callbacks, so they don't have to keep asking.

DEBUG CODE
Currently I have a fair amount of debug code built into the Serial class, to help debug, including fast functions to set/clear/toggle digital pins as well as to maybe save some state information. I have hopefully all of this under #ifdef

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Aug 8, 2023
@KurtE KurtE marked this pull request as ready for review August 10, 2023 17:24
@KurtE
Copy link
Contributor Author

KurtE commented Aug 10, 2023

I have done some test runs with WIFI code as well as BLE and this morning they ran.

So probably time to start the review process

@github-actions
Copy link

Memory usage change @ 4cd4a58

Board flash % RAM for global variables %
arduino-git:renesas:minima N/A N/A N/A N/A
arduino-git:renesas:portenta_c33 N/A N/A N/A N/A
arduino-git:renesas:unor4wifi N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 N/A N/A N/A N/A
arduino:renesas_uno:minima N/A N/A N/A N/A
arduino:renesas_uno:unor4wifi N/A N/A N/A N/A
Click for full report table
Board libraries/AnalogWave/examples/DACEqualTemperedScale
flash
% libraries/AnalogWave/examples/DACEqualTemperedScale
RAM for global variables
% libraries/AnalogWave/examples/DACJacques
flash
% libraries/AnalogWave/examples/DACJacques
RAM for global variables
% libraries/AnalogWave/examples/SineWave
flash
% libraries/AnalogWave/examples/SineWave
RAM for global variables
% libraries/Arduino_CAN/examples/CANRead
flash
% libraries/Arduino_CAN/examples/CANRead
RAM for global variables
% libraries/Arduino_CAN/examples/CANWrite
flash
% libraries/Arduino_CAN/examples/CANWrite
RAM for global variables
% libraries/Arduino_FreeRTOS/examples/FreeRTOS-Blink
flash
% libraries/Arduino_FreeRTOS/examples/FreeRTOS-Blink
RAM for global variables
% libraries/EEPROM/examples/eeprom_clear
flash
% libraries/EEPROM/examples/eeprom_clear
RAM for global variables
% libraries/EEPROM/examples/eeprom_crc
flash
% libraries/EEPROM/examples/eeprom_crc
RAM for global variables
% libraries/EEPROM/examples/eeprom_get
flash
% libraries/EEPROM/examples/eeprom_get
RAM for global variables
% libraries/EEPROM/examples/eeprom_iteration
flash
% libraries/EEPROM/examples/eeprom_iteration
RAM for global variables
% libraries/EEPROM/examples/eeprom_put
flash
% libraries/EEPROM/examples/eeprom_put
RAM for global variables
% libraries/EEPROM/examples/eeprom_read
flash
% libraries/EEPROM/examples/eeprom_read
RAM for global variables
% libraries/EEPROM/examples/eeprom_update
flash
% libraries/EEPROM/examples/eeprom_update
RAM for global variables
% libraries/EEPROM/examples/eeprom_write
flash
% libraries/EEPROM/examples/eeprom_write
RAM for global variables
% libraries/RTC/examples/RTC_AutomaticExample
flash
% libraries/RTC/examples/RTC_AutomaticExample
RAM for global variables
% libraries/RTC/examples/RTC_PeriodicExample
flash
% libraries/RTC/examples/RTC_PeriodicExample
RAM for global variables
% libraries/RTC/examples/Test_RTC
flash
% libraries/RTC/examples/Test_RTC
RAM for global variables
% libraries/SoftwareSerial/examples/SerialEcho
flash
% libraries/SoftwareSerial/examples/SerialEcho
RAM for global variables
% libraries/WDT/examples/WatchdogRefresh
flash
% libraries/WDT/examples/WatchdogRefresh
RAM for global variables
% libraries/WiFi/examples/AP_SimpleWebServer
flash
% libraries/WiFi/examples/AP_SimpleWebServer
RAM for global variables
% libraries/WiFi/examples/C3SerialPassthrough
flash
% libraries/WiFi/examples/C3SerialPassthrough
RAM for global variables
% libraries/WiFi/examples/ConnectWithWPA
flash
% libraries/WiFi/examples/ConnectWithWPA
RAM for global variables
% libraries/WiFi/examples/ScanNetworks
flash
% libraries/WiFi/examples/ScanNetworks
RAM for global variables
% libraries/WiFi/examples/ScanNetworksAdvanced
flash
% libraries/WiFi/examples/ScanNetworksAdvanced
RAM for global variables
% libraries/WiFi/examples/SimpleWebServerWiFi
flash
% libraries/WiFi/examples/SimpleWebServerWiFi
RAM for global variables
% libraries/WiFi/examples/WiFiChatServer
flash
% libraries/WiFi/examples/WiFiChatServer
RAM for global variables
% libraries/WiFi/examples/WiFiUdpNtpClient
flash
% libraries/WiFi/examples/WiFiUdpNtpClient
RAM for global variables
% libraries/WiFi/examples/WiFiUdpSendReceiveString
flash
% libraries/WiFi/examples/WiFiUdpSendReceiveString
RAM for global variables
% libraries/WiFi/examples/WiFiWebClient
flash
% libraries/WiFi/examples/WiFiWebClient
RAM for global variables
% libraries/WiFi/examples/WiFiWebClientRepeating
flash
% libraries/WiFi/examples/WiFiWebClientRepeating
RAM for global variables
% libraries/WiFi/examples/WiFiWebClientSSL
flash
% libraries/WiFi/examples/WiFiWebClientSSL
RAM for global variables
% libraries/WiFi/examples/WiFiWebServer
flash
% libraries/WiFi/examples/WiFiWebServer
RAM for global variables
% libraries/UsbMsd/examples/MSD_QSPI
flash
% libraries/UsbMsd/examples/MSD_QSPI
RAM for global variables
% libraries/UsbMsd/examples/MSD_QSPI_SDCard
flash
% libraries/UsbMsd/examples/MSD_QSPI_SDCard
RAM for global variables
% libraries/UsbMsd/examples/MSD_SDCard
flash
% libraries/UsbMsd/examples/MSD_SDCard
RAM for global variables
% libraries/UsbHostMsd/examples/USB_HOST_MSD
flash
% libraries/UsbHostMsd/examples/USB_HOST_MSD
RAM for global variables
% libraries/Storage/examples/FatFsOnQSPIFlash
flash
% libraries/Storage/examples/FatFsOnQSPIFlash
RAM for global variables
% libraries/Storage/examples/LittleFsOnQSPIFlash
flash
% libraries/Storage/examples/LittleFsOnQSPIFlash
RAM for global variables
% libraries/Storage/examples/QSPIFReadPartitions
flash
% libraries/Storage/examples/QSPIFReadPartitions
RAM for global variables
% libraries/Storage/examples/QSPIFormat
flash
% libraries/Storage/examples/QSPIFormat
RAM for global variables
% libraries/Storage/examples/TestCodeFlash
flash
% libraries/Storage/examples/TestCodeFlash
RAM for global variables
% libraries/Storage/examples/TestQSPIF
flash
% libraries/Storage/examples/TestQSPIF
RAM for global variables
% libraries/Storage/examples/TestSDCARD
flash
% libraries/Storage/examples/TestSDCARD
RAM for global variables
% libraries/SSLClient/examples/CertificateUploader
flash
% libraries/SSLClient/examples/CertificateUploader
RAM for global variables
% libraries/SSLClient/examples/TLSCheckEthernet
flash
% libraries/SSLClient/examples/TLSCheckEthernet
RAM for global variables
% libraries/SSLClient/examples/TLSCheckWiFi
flash
% libraries/SSLClient/examples/TLSCheckWiFi
RAM for global variables
% libraries/SE05X/examples/SE05XCertificate
flash
% libraries/SE05X/examples/SE05XCertificate
RAM for global variables
% libraries/SE05X/examples/SE05XImportPublicKey
flash
% libraries/SE05X/examples/SE05XImportPublicKey
RAM for global variables
% libraries/SE05X/examples/SE05XPrivateKey
flash
% libraries/SE05X/examples/SE05XPrivateKey
RAM for global variables
% libraries/SE05X/examples/SE05XRandomNumber
flash
% libraries/SE05X/examples/SE05XRandomNumber
RAM for global variables
% libraries/SE05X/examples/SE05XSerialNumber
flash
% libraries/SE05X/examples/SE05XSerialNumber
RAM for global variables
% libraries/SE05X/examples/SE05XSignAndVerify
flash
% libraries/SE05X/examples/SE05XSignAndVerify
RAM for global variables
% libraries/Ethernet/examples/AdvancedChatServer
flash
% libraries/Ethernet/examples/AdvancedChatServer
RAM for global variables
% libraries/Ethernet/examples/BarometricPressureWebServer
flash
% libraries/Ethernet/examples/BarometricPressureWebServer
RAM for global variables
% libraries/Ethernet/examples/ChatServer
flash
% libraries/Ethernet/examples/ChatServer
RAM for global variables
% libraries/Ethernet/examples/DhcpAddressPrinter
flash
% libraries/Ethernet/examples/DhcpAddressPrinter
RAM for global variables
% libraries/Ethernet/examples/DhcpChatServer
flash
% libraries/Ethernet/examples/DhcpChatServer
RAM for global variables
% libraries/Ethernet/examples/TelnetClient
flash
% libraries/Ethernet/examples/TelnetClient
RAM for global variables
% libraries/Ethernet/examples/UDPSendReceiveString
flash
% libraries/Ethernet/examples/UDPSendReceiveString
RAM for global variables
% libraries/Ethernet/examples/UdpNtpClient
flash
% libraries/Ethernet/examples/UdpNtpClient
RAM for global variables
% libraries/Ethernet/examples/WebClient
flash
% libraries/Ethernet/examples/WebClient
RAM for global variables
% libraries/Ethernet/examples/WebClientRepeating
flash
% libraries/Ethernet/examples/WebClientRepeating
RAM for global variables
% libraries/Ethernet/examples/WebClientSSL
flash
% libraries/Ethernet/examples/WebClientSSL
RAM for global variables
% libraries/Ethernet/examples/WebServer
flash
% libraries/Ethernet/examples/WebServer
RAM for global variables
% libraries/Arduino_CAN/examples/CAN1Read
flash
% libraries/Arduino_CAN/examples/CAN1Read
RAM for global variables
% libraries/Arduino_CAN/examples/CAN1Write
flash
% libraries/Arduino_CAN/examples/CAN1Write
RAM for global variables
% libraries/RTC/examples/RTC_NTPSync
flash
% libraries/RTC/examples/RTC_NTPSync
RAM for global variables
% libraries/RTC/examples/RTC_Alarm
flash
% libraries/RTC/examples/RTC_Alarm
RAM for global variables
% libraries/WiFiS3/examples/AP_SimpleWebServer
flash
% libraries/WiFiS3/examples/AP_SimpleWebServer
RAM for global variables
% libraries/WiFiS3/examples/ConnectWithWPA
flash
% libraries/WiFiS3/examples/ConnectWithWPA
RAM for global variables
% libraries/WiFiS3/examples/ScanNetworks
flash
% libraries/WiFiS3/examples/ScanNetworks
RAM for global variables
% libraries/WiFiS3/examples/ScanNetworksAdvanced
flash
% libraries/WiFiS3/examples/ScanNetworksAdvanced
RAM for global variables
% libraries/WiFiS3/examples/SimpleWebServerWiFi
flash
% libraries/WiFiS3/examples/SimpleWebServerWiFi
RAM for global variables
% libraries/WiFiS3/examples/WiFiChatServer
flash
% libraries/WiFiS3/examples/WiFiChatServer
RAM for global variables
% libraries/WiFiS3/examples/WiFiUdpNtpClient
flash
% libraries/WiFiS3/examples/WiFiUdpNtpClient
RAM for global variables
% libraries/WiFiS3/examples/WiFiUdpSendReceiveString
flash
% libraries/WiFiS3/examples/WiFiUdpSendReceiveString
RAM for global variables
% libraries/WiFiS3/examples/WiFiWebClient
flash
% libraries/WiFiS3/examples/WiFiWebClient
RAM for global variables
% libraries/WiFiS3/examples/WiFiWebClientRepeating
flash
% libraries/WiFiS3/examples/WiFiWebClientRepeating
RAM for global variables
% libraries/WiFiS3/examples/WiFiWebClientSSL
flash
% libraries/WiFiS3/examples/WiFiWebClientSSL
RAM for global variables
% libraries/WiFiS3/examples/WiFiWebServer
flash
% libraries/WiFiS3/examples/WiFiWebServer
RAM for global variables
%
arduino-git:renesas:minima N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino-git:renesas:portenta_c33 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino-git:renesas:unor4wifi N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:renesas_uno:minima N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:renesas_uno:unor4wifi N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
Click for full report CSV
Board,libraries/AnalogWave/examples/DACEqualTemperedScale<br>flash,%,libraries/AnalogWave/examples/DACEqualTemperedScale<br>RAM for global variables,%,libraries/AnalogWave/examples/DACJacques<br>flash,%,libraries/AnalogWave/examples/DACJacques<br>RAM for global variables,%,libraries/AnalogWave/examples/SineWave<br>flash,%,libraries/AnalogWave/examples/SineWave<br>RAM for global variables,%,libraries/Arduino_CAN/examples/CANRead<br>flash,%,libraries/Arduino_CAN/examples/CANRead<br>RAM for global variables,%,libraries/Arduino_CAN/examples/CANWrite<br>flash,%,libraries/Arduino_CAN/examples/CANWrite<br>RAM for global variables,%,libraries/Arduino_FreeRTOS/examples/FreeRTOS-Blink<br>flash,%,libraries/Arduino_FreeRTOS/examples/FreeRTOS-Blink<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_clear<br>flash,%,libraries/EEPROM/examples/eeprom_clear<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_crc<br>flash,%,libraries/EEPROM/examples/eeprom_crc<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_get<br>flash,%,libraries/EEPROM/examples/eeprom_get<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_iteration<br>flash,%,libraries/EEPROM/examples/eeprom_iteration<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_put<br>flash,%,libraries/EEPROM/examples/eeprom_put<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_read<br>flash,%,libraries/EEPROM/examples/eeprom_read<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_update<br>flash,%,libraries/EEPROM/examples/eeprom_update<br>RAM for global variables,%,libraries/EEPROM/examples/eeprom_write<br>flash,%,libraries/EEPROM/examples/eeprom_write<br>RAM for global variables,%,libraries/RTC/examples/RTC_AutomaticExample<br>flash,%,libraries/RTC/examples/RTC_AutomaticExample<br>RAM for global variables,%,libraries/RTC/examples/RTC_PeriodicExample<br>flash,%,libraries/RTC/examples/RTC_PeriodicExample<br>RAM for global variables,%,libraries/RTC/examples/Test_RTC<br>flash,%,libraries/RTC/examples/Test_RTC<br>RAM for global variables,%,libraries/SoftwareSerial/examples/SerialEcho<br>flash,%,libraries/SoftwareSerial/examples/SerialEcho<br>RAM for global variables,%,libraries/WDT/examples/WatchdogRefresh<br>flash,%,libraries/WDT/examples/WatchdogRefresh<br>RAM for global variables,%,libraries/WiFi/examples/AP_SimpleWebServer<br>flash,%,libraries/WiFi/examples/AP_SimpleWebServer<br>RAM for global variables,%,libraries/WiFi/examples/C3SerialPassthrough<br>flash,%,libraries/WiFi/examples/C3SerialPassthrough<br>RAM for global variables,%,libraries/WiFi/examples/ConnectWithWPA<br>flash,%,libraries/WiFi/examples/ConnectWithWPA<br>RAM for global variables,%,libraries/WiFi/examples/ScanNetworks<br>flash,%,libraries/WiFi/examples/ScanNetworks<br>RAM for global variables,%,libraries/WiFi/examples/ScanNetworksAdvanced<br>flash,%,libraries/WiFi/examples/ScanNetworksAdvanced<br>RAM for global variables,%,libraries/WiFi/examples/SimpleWebServerWiFi<br>flash,%,libraries/WiFi/examples/SimpleWebServerWiFi<br>RAM for global variables,%,libraries/WiFi/examples/WiFiChatServer<br>flash,%,libraries/WiFi/examples/WiFiChatServer<br>RAM for global variables,%,libraries/WiFi/examples/WiFiUdpNtpClient<br>flash,%,libraries/WiFi/examples/WiFiUdpNtpClient<br>RAM for global variables,%,libraries/WiFi/examples/WiFiUdpSendReceiveString<br>flash,%,libraries/WiFi/examples/WiFiUdpSendReceiveString<br>RAM for global variables,%,libraries/WiFi/examples/WiFiWebClient<br>flash,%,libraries/WiFi/examples/WiFiWebClient<br>RAM for global variables,%,libraries/WiFi/examples/WiFiWebClientRepeating<br>flash,%,libraries/WiFi/examples/WiFiWebClientRepeating<br>RAM for global variables,%,libraries/WiFi/examples/WiFiWebClientSSL<br>flash,%,libraries/WiFi/examples/WiFiWebClientSSL<br>RAM for global variables,%,libraries/WiFi/examples/WiFiWebServer<br>flash,%,libraries/WiFi/examples/WiFiWebServer<br>RAM for global variables,%,libraries/UsbMsd/examples/MSD_QSPI<br>flash,%,libraries/UsbMsd/examples/MSD_QSPI<br>RAM for global variables,%,libraries/UsbMsd/examples/MSD_QSPI_SDCard<br>flash,%,libraries/UsbMsd/examples/MSD_QSPI_SDCard<br>RAM for global variables,%,libraries/UsbMsd/examples/MSD_SDCard<br>flash,%,libraries/UsbMsd/examples/MSD_SDCard<br>RAM for global variables,%,libraries/UsbHostMsd/examples/USB_HOST_MSD<br>flash,%,libraries/UsbHostMsd/examples/USB_HOST_MSD<br>RAM for global variables,%,libraries/Storage/examples/FatFsOnQSPIFlash<br>flash,%,libraries/Storage/examples/FatFsOnQSPIFlash<br>RAM for global variables,%,libraries/Storage/examples/LittleFsOnQSPIFlash<br>flash,%,libraries/Storage/examples/LittleFsOnQSPIFlash<br>RAM for global variables,%,libraries/Storage/examples/QSPIFReadPartitions<br>flash,%,libraries/Storage/examples/QSPIFReadPartitions<br>RAM for global variables,%,libraries/Storage/examples/QSPIFormat<br>flash,%,libraries/Storage/examples/QSPIFormat<br>RAM for global variables,%,libraries/Storage/examples/TestCodeFlash<br>flash,%,libraries/Storage/examples/TestCodeFlash<br>RAM for global variables,%,libraries/Storage/examples/TestQSPIF<br>flash,%,libraries/Storage/examples/TestQSPIF<br>RAM for global variables,%,libraries/Storage/examples/TestSDCARD<br>flash,%,libraries/Storage/examples/TestSDCARD<br>RAM for global variables,%,libraries/SSLClient/examples/CertificateUploader<br>flash,%,libraries/SSLClient/examples/CertificateUploader<br>RAM for global variables,%,libraries/SSLClient/examples/TLSCheckEthernet<br>flash,%,libraries/SSLClient/examples/TLSCheckEthernet<br>RAM for global variables,%,libraries/SSLClient/examples/TLSCheckWiFi<br>flash,%,libraries/SSLClient/examples/TLSCheckWiFi<br>RAM for global variables,%,libraries/SE05X/examples/SE05XCertificate<br>flash,%,libraries/SE05X/examples/SE05XCertificate<br>RAM for global variables,%,libraries/SE05X/examples/SE05XImportPublicKey<br>flash,%,libraries/SE05X/examples/SE05XImportPublicKey<br>RAM for global variables,%,libraries/SE05X/examples/SE05XPrivateKey<br>flash,%,libraries/SE05X/examples/SE05XPrivateKey<br>RAM for global variables,%,libraries/SE05X/examples/SE05XRandomNumber<br>flash,%,libraries/SE05X/examples/SE05XRandomNumber<br>RAM for global variables,%,libraries/SE05X/examples/SE05XSerialNumber<br>flash,%,libraries/SE05X/examples/SE05XSerialNumber<br>RAM for global variables,%,libraries/SE05X/examples/SE05XSignAndVerify<br>flash,%,libraries/SE05X/examples/SE05XSignAndVerify<br>RAM for global variables,%,libraries/Ethernet/examples/AdvancedChatServer<br>flash,%,libraries/Ethernet/examples/AdvancedChatServer<br>RAM for global variables,%,libraries/Ethernet/examples/BarometricPressureWebServer<br>flash,%,libraries/Ethernet/examples/BarometricPressureWebServer<br>RAM for global variables,%,libraries/Ethernet/examples/ChatServer<br>flash,%,libraries/Ethernet/examples/ChatServer<br>RAM for global variables,%,libraries/Ethernet/examples/DhcpAddressPrinter<br>flash,%,libraries/Ethernet/examples/DhcpAddressPrinter<br>RAM for global variables,%,libraries/Ethernet/examples/DhcpChatServer<br>flash,%,libraries/Ethernet/examples/DhcpChatServer<br>RAM for global variables,%,libraries/Ethernet/examples/TelnetClient<br>flash,%,libraries/Ethernet/examples/TelnetClient<br>RAM for global variables,%,libraries/Ethernet/examples/UDPSendReceiveString<br>flash,%,libraries/Ethernet/examples/UDPSendReceiveString<br>RAM for global variables,%,libraries/Ethernet/examples/UdpNtpClient<br>flash,%,libraries/Ethernet/examples/UdpNtpClient<br>RAM for global variables,%,libraries/Ethernet/examples/WebClient<br>flash,%,libraries/Ethernet/examples/WebClient<br>RAM for global variables,%,libraries/Ethernet/examples/WebClientRepeating<br>flash,%,libraries/Ethernet/examples/WebClientRepeating<br>RAM for global variables,%,libraries/Ethernet/examples/WebClientSSL<br>flash,%,libraries/Ethernet/examples/WebClientSSL<br>RAM for global variables,%,libraries/Ethernet/examples/WebServer<br>flash,%,libraries/Ethernet/examples/WebServer<br>RAM for global variables,%,libraries/Arduino_CAN/examples/CAN1Read<br>flash,%,libraries/Arduino_CAN/examples/CAN1Read<br>RAM for global variables,%,libraries/Arduino_CAN/examples/CAN1Write<br>flash,%,libraries/Arduino_CAN/examples/CAN1Write<br>RAM for global variables,%,libraries/RTC/examples/RTC_NTPSync<br>flash,%,libraries/RTC/examples/RTC_NTPSync<br>RAM for global variables,%,libraries/RTC/examples/RTC_Alarm<br>flash,%,libraries/RTC/examples/RTC_Alarm<br>RAM for global variables,%,libraries/WiFiS3/examples/AP_SimpleWebServer<br>flash,%,libraries/WiFiS3/examples/AP_SimpleWebServer<br>RAM for global variables,%,libraries/WiFiS3/examples/ConnectWithWPA<br>flash,%,libraries/WiFiS3/examples/ConnectWithWPA<br>RAM for global variables,%,libraries/WiFiS3/examples/ScanNetworks<br>flash,%,libraries/WiFiS3/examples/ScanNetworks<br>RAM for global variables,%,libraries/WiFiS3/examples/ScanNetworksAdvanced<br>flash,%,libraries/WiFiS3/examples/ScanNetworksAdvanced<br>RAM for global variables,%,libraries/WiFiS3/examples/SimpleWebServerWiFi<br>flash,%,libraries/WiFiS3/examples/SimpleWebServerWiFi<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiChatServer<br>flash,%,libraries/WiFiS3/examples/WiFiChatServer<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiUdpNtpClient<br>flash,%,libraries/WiFiS3/examples/WiFiUdpNtpClient<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiUdpSendReceiveString<br>flash,%,libraries/WiFiS3/examples/WiFiUdpSendReceiveString<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiWebClient<br>flash,%,libraries/WiFiS3/examples/WiFiWebClient<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiWebClientRepeating<br>flash,%,libraries/WiFiS3/examples/WiFiWebClientRepeating<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiWebClientSSL<br>flash,%,libraries/WiFiS3/examples/WiFiWebClientSSL<br>RAM for global variables,%,libraries/WiFiS3/examples/WiFiWebServer<br>flash,%,libraries/WiFiS3/examples/WiFiWebServer<br>RAM for global variables,%
arduino-git:renesas:minima,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
arduino-git:renesas:portenta_c33,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A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,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A

This is a reasonably major update to the Serial(UART)
code base, which is mostly concentrated on the Output(TX)
side of it.

Simple part of the description:
The currently released code, did not use the FIFO object that
was built into the Serial object.  Instead it would output one
character at a time and then wait for a callback from the lower
level code base, which could be TDRE or TEND (mostly likely TDRE)
before it would return from the call.  There were several other
methods that did not work or were not implemented including:
flush(), availableForWrite().

Also the write with buffer and count did not work as it did
not have the same parameters as the one in the Print class, so
the print class simply enumerated each byte.

**More Complex stuff:**
**Write Call**
I added a 16 byte buffer to the UART class that I use to pass down to
the R_SCI_UART_Write calls, with as much data as I have up to 16 from the
write method if a write is not currently in process. If not active and
the FIFO is empty. I detect that and bypass using FIFO up to the first
16 characters.  If write is active, the new data is added to the FIFO.

**UART_EVENT_TX_DATA_EMPTY**
Note: I mention TDRE here, but also cases for FIFO which are different.
When lower level completes the write, it will do a callback with the
event: UART_EVENT_TX_DATA_EMPTY.  First try was to simply grab what is
available up to 16 bytes and recall R_SCI_UART_Write with that.  But that
can lose data, as the callback is called when the ISR code has put the last
byte into the TDR register, and the Write call always tries to put the first
character out, which if the TDRE state is not set, will lose the last byte.
Found I needed to handle two cases:
1) If TDRE I call the write function again.
2) if not TDRE, I update the Buffer/count member variables and reset which interrupt
events which will happen.

**TIMING**
I was still running into conditions where either data was lost or the transfers did
not work correctly.

RingBuffer:
Found in several cases we were spending too much time in the ISR and
we could lose interrupts on either UARTS or the same UARTS but different Interrupt.
Found a lot of the time was spent in the SafeRingBufferN code, where it creates a class object
which disables all interrupts and maybe reenables them at the end.  This is needed as the API/
RingBufferN code is inherently unsafe to use here.  I created my own versions of these classes
that make the RingBuffer class safer such that the Safe version could be a minimal subset.
That decreased the overhead a lot.

FIFO Size:
When using one of the UARTS with FIFO, we filled the RX before any was returned. So the ISR might need to process 16 characters, which took awhile.  I have it currently set to 8.  I
updated all of the Variants to allow each to set their preference.

**RX**
As mentioned above, when we receive bytes and the ISR is triggered, it calls our callback with
the UART_EVENT_RX_CHAR event.  For simple double buffer UARTS, we simply store one character away.

However for FIFO UARTS, it will callback to us one time for each character in the FIFO.  Which
 before took a lot of time. As for character it would setup the callback, call it, where we
 disabled the interrupts...

The new cod instead extracts the remaining characters from the FIFO and stuffs them directly
back into our fifo queue.

To keep from having to look each time at, am I running on a FIFO queue or not, I have two
 different callbacks, so they don't have to keep asking.

**DEBUG CODE**
Currently I have a fair amount of debug code built into the Serial class, to help
debug, including fast functions to set/clear/toggle digital pins as well as to maybe
save some state information.  I have hopefully all of this under #ifdef
this includes a lot of debug code.
A better implementation for ringbuffers
pennam pushed a commit to pennam/ArduinoCore-renesas that referenced this pull request Jan 5, 2024
cristidragomir97 pushed a commit to cristidragomir97/ArduinoCore-renesas that referenced this pull request May 20, 2024
Storage: LittleFs example update
Former-commit-id: 2a9b446
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serial[x].print/write - Could use some major performance enhancement.
2 participants