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

Fix: Support all boards supported with arduino-pico core #129

Merged
merged 3 commits into from
Aug 21, 2021

Conversation

aentinger
Copy link
Member

No description provided.

@aentinger aentinger added topic: firmware Code that runs on an embedded system. type: enhancement PR to improve the project. labels Aug 21, 2021
@aentinger aentinger self-assigned this Aug 21, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2021

Codecov Report

Merging #129 (c9ad93c) into master (dea5853) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #129   +/-   ##
=======================================
  Coverage   85.64%   85.64%           
=======================================
  Files          17       17           
  Lines         641      641           
=======================================
  Hits          549      549           
  Misses         92       92           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dea5853...c9ad93c. Read the comment docs.

…ct (somehow for this board CritSec-mbed.cpp is also built.
@aentinger
Copy link
Member Author

This c9ad93c is puzzling me though. @per1234 any thoughts why this fix is necessary? Context: In 8d422f1 the CI build for the arduino:mbed_nano:nanorp2040connect is failing because code in both CritSec-mbed.cpp and CritSec-rp2040.cpp is compiled leading to a linker error. However, CritSec-rp2040.cpp should not be compiled at all in this scenario. It appears as if the define ARDUINO_ARCH_RP2040 is also present during arduino:mbed_nano:nanorp2040connect build 😕 ❓

@github-actions
Copy link

Memory usage change @ c9ad93c

Board flash % RAM for global variables %
arduino:mbed_edge:edge_control 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
rp2040:rp2040:rpipico 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/UAVCAN-BMS-Subscribe
flash
% examples/UAVCAN-BMS-Subscribe
RAM for global variables
% examples/UAVCAN-Blink
flash
% examples/UAVCAN-Blink
RAM for global variables
% examples/UAVCAN-GNSS-Node
flash
% examples/UAVCAN-GNSS-Node
RAM for global variables
% examples/UAVCAN-Heartbeat-Publish
flash
% examples/UAVCAN-Heartbeat-Publish
RAM for global variables
% examples/UAVCAN-Heartbeat-Subscribe
flash
% examples/UAVCAN-Heartbeat-Subscribe
RAM for global variables
% examples/UAVCAN-Service-Client
flash
% examples/UAVCAN-Service-Client
RAM for global variables
% examples/UAVCAN-Service-Server
flash
% examples/UAVCAN-Service-Server
RAM for global variables
% examples/UAVCAN-ToF-Distance-Sensor-Node
flash
% examples/UAVCAN-ToF-Distance-Sensor-Node
RAM for global variables
%
arduino:mbed_edge:edge_control 0 0.0 0 0.0 0 0.0 0 0.0 0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 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrzero 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
rp2040:rp2040:rpipico 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/UAVCAN-BMS-Subscribe<br>flash,%,examples/UAVCAN-BMS-Subscribe<br>RAM for global variables,%,examples/UAVCAN-Blink<br>flash,%,examples/UAVCAN-Blink<br>RAM for global variables,%,examples/UAVCAN-GNSS-Node<br>flash,%,examples/UAVCAN-GNSS-Node<br>RAM for global variables,%,examples/UAVCAN-Heartbeat-Publish<br>flash,%,examples/UAVCAN-Heartbeat-Publish<br>RAM for global variables,%,examples/UAVCAN-Heartbeat-Subscribe<br>flash,%,examples/UAVCAN-Heartbeat-Subscribe<br>RAM for global variables,%,examples/UAVCAN-Service-Client<br>flash,%,examples/UAVCAN-Service-Client<br>RAM for global variables,%,examples/UAVCAN-Service-Server<br>flash,%,examples/UAVCAN-Service-Server<br>RAM for global variables,%,examples/UAVCAN-ToF-Distance-Sensor-Node<br>flash,%,examples/UAVCAN-ToF-Distance-Sensor-Node<br>RAM for global variables,%
arduino:mbed_edge:edge_control,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrfox1200,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrgsm1400,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrnb1500,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrvidor4000,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrzero,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
rp2040:rp2040:rpipico,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@per1234
Copy link
Contributor

per1234 commented Aug 21, 2021

Here it is:
https://github.com/arduino/ArduinoCore-mbed/blob/2.4.1/boards.txt#L206

nanorp2040connect.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040

That compiler.mbed.arch.define property is passed to the compiler here:

https://github.com/arduino/ArduinoCore-mbed/blob/2.4.1/platform.txt#L27

compiler.cpp.flags=-c {compiler.warning_flags} -g3 -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cxxflags}" {compiler.mbed.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}

https://github.com/arduino/ArduinoCore-mbed/blob/2.4.1/platform.txt#L77

recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_MBED {build.library_discovery_phase_flag} {includes} {build.extra_flags} {compiler.cpp.extra_flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" "-iprefix{build.core.path}" "@{compiler.mbed.includes}" "{source_file}" -o "{object_file}"

@aentinger
Copy link
Member Author

Thank you @per1234 🚀

I'd thought we use ARDUINO_ARCH_* only for platform names, e.g. SAMD, MBED, etc. Is this one possibly a bug in our core or just a unlucky coincidence @facchinm?

Anyways, I'll merge this PR, but I'd like to continoue the discussion.

@aentinger aentinger merged commit 4116902 into master Aug 21, 2021
@aentinger aentinger deleted the fix-rp2040-crit-sec branch August 21, 2021 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: firmware Code that runs on an embedded system. type: enhancement PR to improve the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants