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

nmasic: limit retries in wait_for_bootrom() #335

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

benpicco
Copy link

If no device is connected or init failed, wait_for_bootrom() will be stuck in an infinite loop trying to get a result from nm_read_reg().

Place an upper limit on the number of retries so we can recover from this instead of being stuck here.

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Memory usage change @ 1d3796f

Board flash % RAM for global variables %
Intel:arc32:arduino_101 🔺 0 - +8 0.0 - +0.01 N/A N/A
arduino:avr:mega 🔺 +16 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:avr:uno 🔺 +16 - +24 +0.05 - +0.07 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 🔺 0 - +8 0.0 - 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/AP_SimpleWebServer
flash
% examples/AP_SimpleWebServer
RAM for global variables
% examples/CheckWifi101FirmwareVersion
flash
% examples/CheckWifi101FirmwareVersion
RAM for global variables
% examples/ConnectNoEncryption
flash
% examples/ConnectNoEncryption
RAM for global variables
% examples/ConnectWithWEP
flash
% examples/ConnectWithWEP
RAM for global variables
% examples/ConnectWithWPA
flash
% examples/ConnectWithWPA
RAM for global variables
% examples/MDNS_WiFiWebServer
flash
% examples/MDNS_WiFiWebServer
RAM for global variables
% examples/Provisioning_WiFiWebServer
flash
% examples/Provisioning_WiFiWebServer
RAM for global variables
% examples/ScanNetworks
flash
% examples/ScanNetworks
RAM for global variables
% examples/ScanNetworksAdvanced
flash
% examples/ScanNetworksAdvanced
RAM for global variables
% examples/SimpleWebServerWiFi
flash
% examples/SimpleWebServerWiFi
RAM for global variables
% examples/WiFiChatServer
flash
% examples/WiFiChatServer
RAM for global variables
% examples/WiFiPing
flash
% examples/WiFiPing
RAM for global variables
% examples/WiFiSSLClient
flash
% examples/WiFiSSLClient
RAM for global variables
% examples/WiFiUdpNtpClient
flash
% examples/WiFiUdpNtpClient
RAM for global variables
% examples/WiFiUdpSendReceiveString
flash
% examples/WiFiUdpSendReceiveString
RAM for global variables
% examples/WiFiWebClient
flash
% examples/WiFiWebClient
RAM for global variables
% examples/WiFiWebClientRepeating
flash
% examples/WiFiWebClientRepeating
RAM for global variables
% examples/WiFiWebServer
flash
% examples/WiFiWebServer
RAM for global variables
% examples/FirmwareUpdater
flash
% examples/FirmwareUpdater
RAM for global variables
%
Intel:arc32:arduino_101 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 8 0.01 N/A N/A 0 0.0 N/A N/A
arduino:avr:mega 16 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0
arduino:avr:uno 16 0.05 0 0.0 24 0.07 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0 16 0.05 0 0.0
arduino:sam:arduino_due_x_dbg 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 8 0.0 N/A N/A 0 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/AP_SimpleWebServer<br>flash,%,examples/AP_SimpleWebServer<br>RAM for global variables,%,examples/CheckWifi101FirmwareVersion<br>flash,%,examples/CheckWifi101FirmwareVersion<br>RAM for global variables,%,examples/ConnectNoEncryption<br>flash,%,examples/ConnectNoEncryption<br>RAM for global variables,%,examples/ConnectWithWEP<br>flash,%,examples/ConnectWithWEP<br>RAM for global variables,%,examples/ConnectWithWPA<br>flash,%,examples/ConnectWithWPA<br>RAM for global variables,%,examples/MDNS_WiFiWebServer<br>flash,%,examples/MDNS_WiFiWebServer<br>RAM for global variables,%,examples/Provisioning_WiFiWebServer<br>flash,%,examples/Provisioning_WiFiWebServer<br>RAM for global variables,%,examples/ScanNetworks<br>flash,%,examples/ScanNetworks<br>RAM for global variables,%,examples/ScanNetworksAdvanced<br>flash,%,examples/ScanNetworksAdvanced<br>RAM for global variables,%,examples/SimpleWebServerWiFi<br>flash,%,examples/SimpleWebServerWiFi<br>RAM for global variables,%,examples/WiFiChatServer<br>flash,%,examples/WiFiChatServer<br>RAM for global variables,%,examples/WiFiPing<br>flash,%,examples/WiFiPing<br>RAM for global variables,%,examples/WiFiSSLClient<br>flash,%,examples/WiFiSSLClient<br>RAM for global variables,%,examples/WiFiUdpNtpClient<br>flash,%,examples/WiFiUdpNtpClient<br>RAM for global variables,%,examples/WiFiUdpSendReceiveString<br>flash,%,examples/WiFiUdpSendReceiveString<br>RAM for global variables,%,examples/WiFiWebClient<br>flash,%,examples/WiFiWebClient<br>RAM for global variables,%,examples/WiFiWebClientRepeating<br>flash,%,examples/WiFiWebClientRepeating<br>RAM for global variables,%,examples/WiFiWebServer<br>flash,%,examples/WiFiWebServer<br>RAM for global variables,%,examples/FirmwareUpdater<br>flash,%,examples/FirmwareUpdater<br>RAM for global variables,%
Intel:arc32:arduino_101,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,8,0.01,N/A,N/A,0,0.0,N/A,N/A
arduino:avr:mega,16,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,,,,
arduino:avr:uno,16,0.05,0,0.0,24,0.07,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,16,0.05,0,0.0,,,,
arduino:sam:arduino_due_x_dbg,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,8,0.0,N/A,N/A,0,0.0,N/A,N/A
arduino:samd:arduino_zero_edbg,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0

If no device is connected or init failed, wait_for_bootrom() will
be stuck in an infinite loop trying to get a result from nm_read_reg().

Place an upper limit on the number of retries so we can recover from
this instead of being stuck here.
@github-actions
Copy link

Memory usage change @ 6416928

Board flash % RAM for global variables %
Intel:arc32:arduino_101 🔺 0 - +28 0.0 - +0.02 N/A N/A
arduino:avr:mega 🔺 +34 - +42 +0.01 - +0.02 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 🔺 0 - +32 0.0 - +0.01 N/A N/A
arduino:samd:arduino_zero_edbg 🔺 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 🔺 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/AP_SimpleWebServer
flash
% examples/AP_SimpleWebServer
RAM for global variables
% examples/CheckWifi101FirmwareVersion
flash
% examples/CheckWifi101FirmwareVersion
RAM for global variables
% examples/ConnectNoEncryption
flash
% examples/ConnectNoEncryption
RAM for global variables
% examples/ConnectWithWEP
flash
% examples/ConnectWithWEP
RAM for global variables
% examples/ConnectWithWPA
flash
% examples/ConnectWithWPA
RAM for global variables
% examples/MDNS_WiFiWebServer
flash
% examples/MDNS_WiFiWebServer
RAM for global variables
% examples/Provisioning_WiFiWebServer
flash
% examples/Provisioning_WiFiWebServer
RAM for global variables
% examples/ScanNetworks
flash
% examples/ScanNetworks
RAM for global variables
% examples/ScanNetworksAdvanced
flash
% examples/ScanNetworksAdvanced
RAM for global variables
% examples/SimpleWebServerWiFi
flash
% examples/SimpleWebServerWiFi
RAM for global variables
% examples/WiFiChatServer
flash
% examples/WiFiChatServer
RAM for global variables
% examples/WiFiPing
flash
% examples/WiFiPing
RAM for global variables
% examples/WiFiSSLClient
flash
% examples/WiFiSSLClient
RAM for global variables
% examples/WiFiUdpNtpClient
flash
% examples/WiFiUdpNtpClient
RAM for global variables
% examples/WiFiUdpSendReceiveString
flash
% examples/WiFiUdpSendReceiveString
RAM for global variables
% examples/WiFiWebClient
flash
% examples/WiFiWebClient
RAM for global variables
% examples/WiFiWebClientRepeating
flash
% examples/WiFiWebClientRepeating
RAM for global variables
% examples/WiFiWebServer
flash
% examples/WiFiWebServer
RAM for global variables
% examples/FirmwareUpdater
flash
% examples/FirmwareUpdater
RAM for global variables
%
Intel:arc32:arduino_101 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 28 0.02 N/A N/A 0 0.0 N/A N/A
arduino:avr:mega 34 0.01 0 0.0 42 0.02 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0 34 0.01 0 0.0
arduino:sam:arduino_due_x_dbg 32 0.01 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 32 0.01 N/A N/A 32 0.01 N/A N/A 24 0.0 N/A N/A 32 0.01 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 32 0.01 N/A N/A 32 0.01 N/A N/A 24 0.0 N/A N/A 24 0.0 N/A N/A 0 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 32 0.01 0 0.0 32 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 32 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/AP_SimpleWebServer<br>flash,%,examples/AP_SimpleWebServer<br>RAM for global variables,%,examples/CheckWifi101FirmwareVersion<br>flash,%,examples/CheckWifi101FirmwareVersion<br>RAM for global variables,%,examples/ConnectNoEncryption<br>flash,%,examples/ConnectNoEncryption<br>RAM for global variables,%,examples/ConnectWithWEP<br>flash,%,examples/ConnectWithWEP<br>RAM for global variables,%,examples/ConnectWithWPA<br>flash,%,examples/ConnectWithWPA<br>RAM for global variables,%,examples/MDNS_WiFiWebServer<br>flash,%,examples/MDNS_WiFiWebServer<br>RAM for global variables,%,examples/Provisioning_WiFiWebServer<br>flash,%,examples/Provisioning_WiFiWebServer<br>RAM for global variables,%,examples/ScanNetworks<br>flash,%,examples/ScanNetworks<br>RAM for global variables,%,examples/ScanNetworksAdvanced<br>flash,%,examples/ScanNetworksAdvanced<br>RAM for global variables,%,examples/SimpleWebServerWiFi<br>flash,%,examples/SimpleWebServerWiFi<br>RAM for global variables,%,examples/WiFiChatServer<br>flash,%,examples/WiFiChatServer<br>RAM for global variables,%,examples/WiFiPing<br>flash,%,examples/WiFiPing<br>RAM for global variables,%,examples/WiFiSSLClient<br>flash,%,examples/WiFiSSLClient<br>RAM for global variables,%,examples/WiFiUdpNtpClient<br>flash,%,examples/WiFiUdpNtpClient<br>RAM for global variables,%,examples/WiFiUdpSendReceiveString<br>flash,%,examples/WiFiUdpSendReceiveString<br>RAM for global variables,%,examples/WiFiWebClient<br>flash,%,examples/WiFiWebClient<br>RAM for global variables,%,examples/WiFiWebClientRepeating<br>flash,%,examples/WiFiWebClientRepeating<br>RAM for global variables,%,examples/WiFiWebServer<br>flash,%,examples/WiFiWebServer<br>RAM for global variables,%,examples/FirmwareUpdater<br>flash,%,examples/FirmwareUpdater<br>RAM for global variables,%
Intel:arc32:arduino_101,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,28,0.02,N/A,N/A,0,0.0,N/A,N/A
arduino:avr:mega,34,0.01,0,0.0,42,0.02,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,,,,
arduino:sam:arduino_due_x_dbg,32,0.01,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,32,0.01,N/A,N/A,32,0.01,N/A,N/A,24,0.0,N/A,N/A,32,0.01,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,32,0.01,N/A,N/A,32,0.01,N/A,N/A,24,0.0,N/A,N/A,24,0.0,N/A,N/A,0,0.0,N/A,N/A
arduino:samd:arduino_zero_edbg,32,0.01,0,0.0,32,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,32,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 23, 2022
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.

None yet

3 participants