RP2040 ram and rom usage?
-
- Posts: 63
- http://meble-kuchenne.info.pl
- Joined: Fri Dec 18, 2020 1:15 pm
- Has thanked: 24 times
Re: RP2040 ram and rom usage?
Oh, and pin25 isn't defined in the PICO file. So I don't think that will work either. It would in the rp2040.
-
- Valued Contributor
- Posts: 401
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 73 times
- Been thanked: 218 times
Re: RP2040 ram and rom usage?
Hi Chad,
I now have this working (again)
The missing link is ...
Step 1
Add pico_multicore to target_link_libraries in CMakeLists.txt
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PICO\batch
Step 2
In your project "Supplementary code" -> "Definitions" add the following (Ben: could probably go in the FCDs)
Step 3
Put the code that you want to run in the second core into a Flowcode macro, e.g. CORE2
Launch it from the following C code icon in the Main macro
All done, delete any pre-existing build directory and recompile.
btw. (Using target Pi Pico) For the onboard LED you can use the following in a Calculation icon
edit: Ah, and last but not least, be careful with using two cores, functions aren't necessarily thread safe
I now have this working (again)
The missing link is ...
Step 1
Add pico_multicore to target_link_libraries in CMakeLists.txt
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PICO\batch
Code: Select all
target_link_libraries(flowcode pico_stdlib hardware_adc hardware_spi hardware_pwm hardware_i2c pico_multicore)
In your project "Supplementary code" -> "Definitions" add the following (Ben: could probably go in the FCDs)
Code: Select all
#include "pico/multicore.h"
Put the code that you want to run in the second core into a Flowcode macro, e.g. CORE2
Launch it from the following C code icon in the Main macro
Code: Select all
multicore_launch_core1(FCM_CORE2);
btw. (Using target Pi Pico) For the onboard LED you can use the following in a Calculation icon
Code: Select all
$PORTA.25 = 1
edit: Ah, and last but not least, be careful with using two cores, functions aren't necessarily thread safe
-
- Valued Contributor
- Posts: 1203
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 289 times
- Been thanked: 424 times
Re: RP2040 ram and rom usage?
Hi Leigh
Huge thanks for this, works a treat.
With this extra power surely my world domination is a few steps closer
Best regards
PS
Huge thanks for this, works a treat.
With this extra power surely my world domination is a few steps closer
Best regards
PS
Re: RP2040 ram and rom usage?
That's great! I'll give it a whirl a little later.
Thanks,
Chad
*Edit: Works! Thank you.
Thanks,
Chad
*Edit: Works! Thank you.