c046b23ea2
Helps prevent the filesystem from getting formatted by mistake, among other things. For example, on a Pico board, entering Ctrl+D and Ctrl+C fast many times will eventually wipe the filesystem (without warning or notice). Further rationale: Ctrl+C is used a lot by automation scripts (eg mpremote) and UI's (eg Mu, Thonny) to get the board into a known state. If the board is not responding for a short time then it's not possible to know if it's just a slow start up (eg in _boot.py), or an infinite loop in the main application. The former should not be interrupted, but the latter should. The only way to distinguish these two cases would be to wait "long enough", and if there's nothing on the serial after "long enough" then assume it's running the application and Ctrl+C should break out of it. But defining "long enough" is impossible for all the different boards and their possible behaviour. The solution in this commit is to make it so that frozen start-up code cannot be interrupted by Ctrl+C. That code then effectively acts like normal C start-up code, which also cannot be interrupted. Note: on the stm32 port this was never seen as an issue because all start-up code is in C. But now other ports start to put more things in _boot.py and so this problem crops up. Signed-off-by: David Grayson <davidegrayson@gmail.com> |
||
---|---|---|
.. | ||
boards | ||
ra | ||
boardctrl.c | ||
boardctrl.h | ||
build_all_boards.sh | ||
extint.c | ||
extint.h | ||
factoryreset.c | ||
factoryreset.h | ||
fatfs_port.c | ||
flash.c | ||
flash.h | ||
flashbdev.c | ||
gccollect.c | ||
gccollect.h | ||
help.c | ||
irq.c | ||
irq.h | ||
led.c | ||
led.h | ||
machine_adc.c | ||
machine_i2c.c | ||
machine_pin.c | ||
machine_rtc.c | ||
machine_spi.c | ||
machine_uart.c | ||
main.c | ||
Makefile | ||
modmachine.c | ||
modmachine.h | ||
moduos.c | ||
modutime.c | ||
mpconfigboard_common.h | ||
mpconfigport.h | ||
mpconfigport.mk | ||
mphalport.c | ||
mphalport.h | ||
mpthreadport.c | ||
mpthreadport.h | ||
pendsv.c | ||
pendsv.h | ||
pin.h | ||
powerctrl.c | ||
powerctrl.h | ||
powerctrlboot.c | ||
pybthread.c | ||
pybthread.h | ||
qstrdefsport.h | ||
RA4M1_hal.h | ||
RA4W1_hal.h | ||
RA6M1_hal.h | ||
RA6M2_hal.h | ||
ra_it.c | ||
ra_it.h | ||
README.md | ||
rtc.h | ||
spi.h | ||
storage.c | ||
storage.h | ||
systick.c | ||
systick.h | ||
timer.c | ||
timer.h | ||
uart.c | ||
uart.h | ||
usrsw.c | ||
usrsw.h |
The Renesas RA port
This is a port of MicroPython to the Renesas RA family of microcontrollers. Currently supported features are:
- Filesystem on the internal flash using FatFs.
utime
module with sleep, time, and ticks functions.uos
module with VFS support.machine
module with the following classes:Pin
,ADC
,I2C
,SPI
,SoftI2C
,SoftSPI
,UART
,RTC
- sdcard driver if frozen driver is installed.
Currently supported board product names are:
- EK-RA6M2
- RA4M1 CLICKER
- EK-RA6M1
- EK-RA4M1
- EK-RA4W1
Please refer to the quick reference of renesas-ra
port for more
information about the boards.
Build instructions
-
MicroPython cross-compier The MicroPython cross-compiler must be built first, which will be used to pre-compile (freeze) built-in Python code. THis cross-compiler is built and run on the host machine, using:
$ make -C mpy-cross
This command should be executed from the root directory of this repository. All other commands below should be executed from the ports/renesas-ra/ directory.
-
Arm compiler An
Arm compiler
is required for the build, along with the associated binary utilities. The default compiler isarm-none-eabi-gcc
, which is available for Linux, Mac and Windows hosts via https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads. The compiler can be changed using theCROSS_COMPILE
variable when invokingmake
. -
Obtain submodules First the submodules must be obtained using:
$ make submodules
-
Build binary image
.hex
Then to build for a given board subdirectory name, run:$ make BOARD=RA6M2_EK clean $ make BOARD=RA6M2_EK
The default board subdirectory name is RA6M2_EK (which is for EK-RA6M2 board) but any of the names of the subdirectories in the
boards/
directory can be passed as the argument toBOARD=
; for exampleRA4M1_CLICKER
,RA4M1_EK
,RA4W1_EK
andRA6M1_EK
. The above command should produce binary imagesfirmware.hex
in the build-RA6M2_EK/` subdirectory (or the equivalent directory for the board specified).
Supported/Unsupprted funtions
Please refer to the renesas-ra
quick reference.
Known issues
all boards
-
machine.lightsleep(time_ms) and machine.deepsleep(time_ms) raise uncaught exceptions.
machine.deepsleep(1000) Uncaught exception in ExtInt interrupt handler line 16 TypeError:
RA4M1-CLICKER
- mpremote: mount command is not available due to limited memory resources.
EK-RA4M1
- mpremote: mount command is not available due to limited memory resources.
EK-RA4W1
- mpremote: "Execution: timeout waiting for remote" error happens when importing a file on /remote.