Common Pitfalls and Constraints

Timing mismatches 

The Scade One model counts logic cycles, not absolute time. If sleep_ms(10) is replaced with a different value, all flashing frequencies are affected proportionally. Always adjust LED_Delay accordingly. 

Renaming generated C files or other files 

All generated files (LED_LED.c, CountCycles_LED.c, etc.) are overwritten every time you regenerate from Scade One. Do not rename or modify them, only the Scade One model. 

If you rename the main.c file, a folder accessed by the CMakeLists (the folder of the Scade One Project) or the folder of the VS project itself, you have to modify in the CMakeLists the name of the folders and the name of the main.c file, and then delete the build folder (located in your VS folder) before the recompilation of the CMakeLists. 

If you don’t delete the build folder, it won’t work. And don’t worry, at each compilation, the build folder is re-created. 

Blocking calls in cyclic execution 

The while loop must remain non-blocking to maintain the 10 ms timing. get_bootsel_button disables interrupts for the duration of the measurement: do not call it from an interrupt handler. 

Definition of swan_config.h 

swan_config.h is not generated automatically. If it is missing, this causes compilation errors such as “swan_bool undeclared”, “swan_uint32 undeclared” or “swan_config.h doesn’t exist”. 

If you have any other issues, it must be either the selection of the board or SDK version when creating the Pico Project, or a missing declaration in the CMakeLists.txt (everything which needs to be added is explained in the document), or a missing file (swan_config.h, don’t forget also to copy/paste your Scade One files into the VSCode folder).