diff --git a/board/BearPi_STM32L431RC/BSP/.mxproject b/board/BearPi_STM32L431RC/BSP/.mxproject index b297bdd2..9788dfa9 100644 --- a/board/BearPi_STM32L431RC/BSP/.mxproject +++ b/board/BearPi_STM32L431RC/BSP/.mxproject @@ -1,14 +1,14 @@ [PreviousGenFiles] HeaderPath=F:/RTOS/TencentOS/TencentOS-tiny/board/BearPi_STM32L31RC/BSP/Inc -HeaderFiles=gpio.h;adc.h;dac.h;i2c.h;usart.h;spi.h;stm32l4xx_it.h;stm32l4xx_hal_conf.h;main.h; +HeaderFiles=gpio.h;adc.h;i2c.h;usart.h;quadspi.h;sdmmc.h;spi.h;stm32l4xx_it.h;stm32l4xx_hal_conf.h;main.h; SourcePath=F:/RTOS/TencentOS/TencentOS-tiny/board/BearPi_STM32L31RC/BSP/Src -SourceFiles=gpio.c;adc.c;dac.c;i2c.c;usart.c;spi.c;stm32l4xx_it.c;stm32l4xx_hal_msp.c;main.c; +SourceFiles=gpio.c;adc.c;i2c.c;usart.c;quadspi.c;sdmmc.c;spi.c;stm32l4xx_it.c;stm32l4xx_hal_msp.c;main.c; [PreviousLibFiles] -LibFiles=Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_def.h;Drivers/STM32L4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ramfunc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_cortex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_exti.h;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_def.h;Drivers/STM32L4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ramfunc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_cortex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_exti.h;Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l431xx.h;Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h;Drivers/CMSIS/Device/ST/STM32L4xx/Include/system_stm32l4xx.h;Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; +LibFiles=Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_def.h;Drivers/STM32L4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ramfunc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_cortex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_exti.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_qspi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_sdmmc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_sd.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_sd_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim_ex.h;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_sdmmc.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_adc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_adc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_def.h;Drivers/STM32L4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_i2c_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ramfunc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_gpio_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_dma_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_pwr_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_cortex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_exti.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_qspi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_sdmmc.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_sd.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_sd_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi_ex.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim_ex.h;Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l431xx.h;Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h;Drivers/CMSIS/Device/ST/STM32L4xx/Include/system_stm32l4xx.h;Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; [PreviousUsedKeilFiles] -SourceFiles=..\Src\main.c;..\Src\gpio.c;..\Src\adc.c;..\Src\i2c.c;..\Src\usart.c;..\Src\spi.c;..\Src\stm32l4xx_it.c;..\Src\stm32l4xx_hal_msp.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c;../\Src/system_stm32l4xx.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c;../\Src/system_stm32l4xx.c;../Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c;null; +SourceFiles=..\Src\main.c;..\Src\gpio.c;..\Src\adc.c;..\Src\i2c.c;..\Src\usart.c;..\Src\quadspi.c;..\Src\sdmmc.c;..\Src\spi.c;..\Src\stm32l4xx_it.c;..\Src\stm32l4xx_hal_msp.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_sdmmc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c;..\\Src/system_stm32l4xx.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_sdmmc.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c;../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c;..\\Src/system_stm32l4xx.c;../Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c;; HeaderPath=..\Drivers\STM32L4xx_HAL_Driver\Inc;..\Drivers\STM32L4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32L4xx\Include;..\Drivers\CMSIS\Include;..\Inc; CDefines=USE_HAL_DRIVER;STM32L431xx;USE_HAL_DRIVER;STM32L431xx; diff --git a/board/BearPi_STM32L431RC/BSP/BearPi_STM32L31RC.ioc b/board/BearPi_STM32L431RC/BSP/BearPi_STM32L31RC.ioc index 77281737..4a6c639d 100644 --- a/board/BearPi_STM32L431RC/BSP/BearPi_STM32L31RC.ioc +++ b/board/BearPi_STM32L431RC/BSP/BearPi_STM32L31RC.ioc @@ -14,17 +14,19 @@ LPUART1.WordLength=UART_WORDLENGTH_8B Mcu.Family=STM32L4 Mcu.IP0=ADC1 Mcu.IP1=I2C1 -Mcu.IP10=USART2 -Mcu.IP11=USART3 +Mcu.IP10=SYS +Mcu.IP11=USART1 +Mcu.IP12=USART2 +Mcu.IP13=USART3 Mcu.IP2=LPUART1 Mcu.IP3=NVIC -Mcu.IP4=RCC -Mcu.IP5=SPI1 -Mcu.IP6=SPI2 -Mcu.IP7=SPI3 -Mcu.IP8=SYS -Mcu.IP9=USART1 -Mcu.IPNb=12 +Mcu.IP4=QUADSPI +Mcu.IP5=RCC +Mcu.IP6=SDMMC1 +Mcu.IP7=SPI1 +Mcu.IP8=SPI2 +Mcu.IP9=SPI3 +Mcu.IPNb=14 Mcu.Name=STM32L431R(B-C)Tx Mcu.Package=LQFP64 Mcu.Pin0=PC13 @@ -35,31 +37,38 @@ Mcu.Pin12=PA4 Mcu.Pin13=PA6 Mcu.Pin14=PC4 Mcu.Pin15=PC5 -Mcu.Pin16=PB2 -Mcu.Pin17=PB13 -Mcu.Pin18=PB15 -Mcu.Pin19=PC6 +Mcu.Pin16=PB0 +Mcu.Pin17=PB1 +Mcu.Pin18=PB2 +Mcu.Pin19=PB10 Mcu.Pin2=PC15-OSC32_OUT (PC15) -Mcu.Pin20=PC7 -Mcu.Pin21=PA9 -Mcu.Pin22=PA10 -Mcu.Pin23=PA12 -Mcu.Pin24=PA15 (JTDI) -Mcu.Pin25=PC10 -Mcu.Pin26=PC11 -Mcu.Pin27=PB3 (JTDO-TRACESWO) -Mcu.Pin28=PB5 -Mcu.Pin29=PB6 +Mcu.Pin20=PB11 +Mcu.Pin21=PB13 +Mcu.Pin22=PB15 +Mcu.Pin23=PC6 +Mcu.Pin24=PC7 +Mcu.Pin25=PC8 +Mcu.Pin26=PA9 +Mcu.Pin27=PA10 +Mcu.Pin28=PA12 +Mcu.Pin29=PA15 (JTDI) Mcu.Pin3=PH0-OSC_IN (PH0) -Mcu.Pin30=PB7 -Mcu.Pin31=VP_SYS_VS_Systick +Mcu.Pin30=PC10 +Mcu.Pin31=PC11 +Mcu.Pin32=PC12 +Mcu.Pin33=PD2 +Mcu.Pin34=PB3 (JTDO-TRACESWO) +Mcu.Pin35=PB5 +Mcu.Pin36=PB6 +Mcu.Pin37=PB7 +Mcu.Pin38=VP_SYS_VS_Systick Mcu.Pin4=PH1-OSC_OUT (PH1) Mcu.Pin5=PC0 Mcu.Pin6=PC1 Mcu.Pin7=PC2 Mcu.Pin8=PC3 Mcu.Pin9=PA1 -Mcu.PinsNb=32 +Mcu.PinsNb=39 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32L431RCTx @@ -68,6 +77,7 @@ MxDb.Version=DB.5.0.30 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.EXTI2_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.ForceEnableDMAVector=true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.LPUART1_IRQn=true\:0\:0\:false\:false\:true\:true\:true NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false @@ -101,6 +111,14 @@ PA6.Mode=Full_Duplex_Master PA6.Signal=SPI1_MISO PA9.Mode=Asynchronous PA9.Signal=USART1_TX +PB0.Mode=Single Bank 1 2IOs +PB0.Signal=QUADSPI_BK1_IO1 +PB1.Mode=Single Bank 1 2IOs +PB1.Signal=QUADSPI_BK1_IO0 +PB10.Mode=Single Bank 1 2IOs +PB10.Signal=QUADSPI_CLK +PB11.Mode=Single Bank 1 2IOs +PB11.Signal=QUADSPI_BK1_NCS PB13.Locked=true PB13.Mode=TX_Only_Simplex_Unidirect_Master PB13.Signal=SPI2_SCK @@ -133,6 +151,8 @@ PC10.Mode=Full_Duplex_Master PC10.Signal=SPI3_SCK PC11.Mode=Full_Duplex_Master PC11.Signal=SPI3_MISO +PC12.Mode=SD_1_bit +PC12.Signal=SDMMC1_CK PC13.GPIOParameters=GPIO_Label PC13.GPIO_Label=LED PC13.Locked=true @@ -158,14 +178,10 @@ PC7.GPIOParameters=GPIO_Label PC7.GPIO_Label=LCD_RST PC7.Locked=true PC7.Signal=GPIO_Output -PCC.Checker=true -PCC.Line=STM32L4x1 -PCC.MCU=STM32L431R(B-C)Tx -PCC.PartNumber=STM32L431RCTx -PCC.Seq0=0 -PCC.Series=STM32L4 -PCC.Temperature=25 -PCC.Vdd=3.0 +PC8.Mode=SD_1_bit +PC8.Signal=SDMMC1_D0 +PD2.Mode=SD_1_bit +PD2.Signal=SDMMC1_CMD PH0-OSC_IN\ (PH0).Mode=HSE-External-Oscillator PH0-OSC_IN\ (PH0).Signal=RCC_OSC_IN PH1-OSC_OUT\ (PH1).Mode=HSE-External-Oscillator @@ -193,11 +209,18 @@ ProjectManager.PreviousToolchain= ProjectManager.ProjectBuild=false ProjectManager.ProjectFileName=BearPi_STM32L31RC.ioc ProjectManager.ProjectName=BearPi_STM32L31RC +ProjectManager.RegisterCallBack= ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=MDK-ARM V5 ProjectManager.ToolChainLocation= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_ADC1_Init-ADC1-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true,5-MX_LPUART1_UART_Init-LPUART1-false-HAL-true,6-MX_USART2_UART_Init-USART2-false-HAL-true,7-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_SPI1_Init-SPI1-false-HAL-true,9-MX_SPI3_Init-SPI3-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_ADC1_Init-ADC1-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true,5-MX_LPUART1_UART_Init-LPUART1-false-HAL-true,6-MX_USART2_UART_Init-USART2-false-HAL-true,7-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_SPI1_Init-SPI1-false-HAL-true,9-MX_SPI3_Init-SPI3-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_USART1_UART_Init-USART1-false-HAL-true,12-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,13-MX_QUADSPI_Init-QUADSPI-false-HAL-true +QUADSPI.ChipSelectHighTime=QSPI_CS_HIGH_TIME_4_CYCLE +QUADSPI.ClockPrescaler=0 +QUADSPI.FifoThreshold=4 +QUADSPI.FlashSize=22 +QUADSPI.IPParameters=ClockPrescaler,FifoThreshold,SampleShifting,FlashSize,ChipSelectHighTime +QUADSPI.SampleShifting=QSPI_SAMPLE_SHIFTING_HALFCYCLE RCC.ADCFreq_Value=32000000 RCC.AHBFreq_Value=80000000 RCC.APB1Freq_Value=80000000 diff --git a/board/BearPi_STM32L431RC/BSP/Hardware/W25QXX-QSPI/w25qxx.c b/board/BearPi_STM32L431RC/BSP/Hardware/W25QXX-QSPI/w25qxx.c new file mode 100644 index 00000000..765370a3 --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Hardware/W25QXX-QSPI/w25qxx.c @@ -0,0 +1,343 @@ +#include "w25qxx.h" +#include "quadspi.h" + +int w25qxx_init(void) +{ + MX_QUADSPI_Init(); + return 0; +} + +int w25qxx_memory_mapped(void) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = FAST_READ_DUAL_IO_CMD, + // Address + .AddressMode = QSPI_ADDRESS_2_LINES, + .Address = 0, // NOT USED for memory-mapped mode + .AddressSize = QSPI_ADDRESS_24_BITS, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_2_LINES, + .AlternateBytes = 0xF0, // M7-M0 should be set to Fxh + .AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_2_LINES, + .NbData = 0, // NOT USED for memory-mapped mode + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + QSPI_MemoryMappedTypeDef cfg = { + .TimeOutPeriod = 0, + .TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE, + }; + if (HAL_QSPI_GetState(&hqspi) != HAL_QSPI_STATE_BUSY_MEM_MAPPED) { + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return -1; + } + if (HAL_QSPI_MemoryMapped(&hqspi, &cmd, &cfg) != HAL_OK) { + return -1; + } + } + return 0; +} + +uint16_t w25qxx_read_deviceid(void) +{ + uint8_t recv_buf[2] = {0}; + uint16_t device_id = 0; + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = ManufactDeviceID_CMD, + // Address + .AddressMode = QSPI_ADDRESS_1_LINE, + .Address = 0, + .AddressSize = QSPI_ADDRESS_24_BITS, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_1_LINE, + .NbData = 2, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return 0; + } + if (HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return 0; + } + if (HAL_QSPI_Receive(&hqspi, recv_buf, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return 0; + } + device_id = (recv_buf[0] << 8) | recv_buf[1]; + return device_id; +} + +static void w25qxx_wait_busy(void) +{ + uint8_t status; + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = READ_STATU_REGISTER_1, + // Address + .AddressMode = QSPI_ADDRESS_NONE, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_1_LINE, + .NbData = 1, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE); + do { + HAL_QSPI_Receive(&hqspi, &status, HAL_QSPI_TIMEOUT_DEFAULT_VALUE); + } while ((status & 0x01) == 0x01); +} + +int w25qxx_read(uint8_t *buffer, uint32_t start_addr, uint16_t nbytes) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = FAST_READ_DUAL_IO_CMD, + // Address + .AddressMode = QSPI_ADDRESS_2_LINES, + .Address = start_addr, + .AddressSize = QSPI_ADDRESS_24_BITS, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_2_LINES, + .AlternateBytes = 0xF0, // M7-M0 should be set to Fxh + .AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_2_LINES, + .NbData = nbytes, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return -1; + } + if (HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + if (HAL_QSPI_Receive(&hqspi, buffer, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + return 0; +} + +static void w25qxx_write_enable(void) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = WRITE_ENABLE_CMD, + // Address + .AddressMode = QSPI_ADDRESS_NONE, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_NONE, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE); + // w25qxx_wait_busy(); +} + +static void w25qxx_write_disable(void) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = WRITE_DISABLE_CMD, + // Address + .AddressMode = QSPI_ADDRESS_NONE, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_NONE, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE); + // w25qxx_wait_busy(); +} + +int w25qxx_erase_sector(uint32_t sector_addr) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = SECTOR_ERASE_CMD, + // Address + .AddressMode = QSPI_ADDRESS_1_LINE, + .Address = sector_addr, + .AddressSize = QSPI_ADDRESS_24_BITS, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_NONE, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + w25qxx_write_enable(); + + if (HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + return 0; +} + +int w25qxx_erase_chip(void) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = CHIP_ERASE_CMD, + // Address + .AddressMode = QSPI_ADDRESS_NONE, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_NONE, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + w25qxx_write_enable(); + + if (HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + return 0; +} + +int w25qxx_page_program(uint8_t *dat, uint32_t write_addr, uint16_t nbytes) +{ + QSPI_CommandTypeDef cmd = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = PAGE_PROGRAM_CMD, + // Address + .AddressMode = QSPI_ADDRESS_1_LINE, + .Address = write_addr, + .AddressSize = QSPI_ADDRESS_24_BITS, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_1_LINE, + .NbData = nbytes, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + w25qxx_write_enable(); + + if (HAL_QSPI_Command(&hqspi, &cmd, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + if (HAL_QSPI_Transmit(&hqspi, dat, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + return 0; +} + +int w25qxx_reset(void) +{ + QSPI_CommandTypeDef cmd1 = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = ENABLE_RESET_CMD, + // Address + .AddressMode = QSPI_ADDRESS_NONE, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_NONE, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + QSPI_CommandTypeDef cmd2 = { + // Instruction + .InstructionMode = QSPI_INSTRUCTION_1_LINE, + .Instruction = RESET_DEVICE_CMD, + // Address + .AddressMode = QSPI_ADDRESS_NONE, + // AlternateByte + .AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE, + // Dummy + .DummyCycles = 0, + // Data + .DataMode = QSPI_DATA_NONE, + // DDR + .DdrMode = QSPI_DDR_MODE_DISABLE, + }; + + if (HAL_QSPI_Abort(&hqspi) != HAL_OK) { + return -1; + } + + if (HAL_QSPI_Command(&hqspi, &cmd1, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + if (HAL_QSPI_Command(&hqspi, &cmd2, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { + return -1; + } + + w25qxx_wait_busy(); + + return 0; +} diff --git a/board/BearPi_STM32L431RC/BSP/Hardware/W25QXX-QSPI/w25qxx.h b/board/BearPi_STM32L431RC/BSP/Hardware/W25QXX-QSPI/w25qxx.h new file mode 100644 index 00000000..b1a2051f --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Hardware/W25QXX-QSPI/w25qxx.h @@ -0,0 +1,40 @@ +#ifndef _W25QXX_H_ +#define _W25QXX_H_ +#include "main.h" + +enum { + ManufactDeviceID_CMD = 0x90, + READ_STATU_REGISTER_1 = 0x05, + READ_STATU_REGISTER_2 = 0x35, + WRITE_STATU_REGISTER = 0x01, + READ_DATA_CMD = 0x03, + FAST_READ_CMD = 0x0B, + FAST_READ_DUAL_O_CMD = 0x3B, + FAST_READ_DUAL_IO_CMD = 0xBB, + FAST_READ_QUAD_O_CMD = 0x6B, + FAST_READ_QUAD_IO_CMD = 0xEB, + WRITE_ENABLE_CMD = 0x06, + WRITE_DISABLE_CMD = 0x04, + SECTOR_ERASE_CMD = 0x20, + CHIP_ERASE_CMD = 0xc7, + PAGE_PROGRAM_CMD = 0x02, + QUAD_PAGE_PROGRAM_CMD = 0x32, + BLOCK_ERASE_64KB_CMD = 0xD8, + BLOCK_ERASE_32KB_CMD = 0x52, + ERASE_SUSPEND_CMD = 0x75, + ERASE_RESUME_CMD = 0x7A, + HIGH_PERFORM_MODE_CMD = 0xA3, + ENABLE_RESET_CMD = 0x66, + RESET_DEVICE_CMD = 0x99, +}; + +int w25qxx_init(void); +int w25qxx_memory_mapped(void); +uint16_t w25qxx_read_deviceid(void); +int w25qxx_read(uint8_t* buffer, uint32_t start_addr, uint16_t nbytes); +int w25qxx_erase_sector(uint32_t sector_addr); +int w25qxx_erase_chip(void); +int w25qxx_page_program(uint8_t* dat, uint32_t write_addr, uint16_t nbytes); +int w25qxx_reset(void); + +#endif /* _W25QXX_H_ */ diff --git a/board/BearPi_STM32L431RC/BSP/Inc/quadspi.h b/board/BearPi_STM32L431RC/BSP/Inc/quadspi.h new file mode 100644 index 00000000..118b51b4 --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Inc/quadspi.h @@ -0,0 +1,58 @@ +/** + ****************************************************************************** + * File Name : QUADSPI.h + * Description : This file provides code for the configuration + * of the QUADSPI instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __quadspi_H +#define __quadspi_H +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern QSPI_HandleTypeDef hqspi; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_QUADSPI_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ quadspi_H */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/BearPi_STM32L431RC/BSP/Inc/sdmmc.h b/board/BearPi_STM32L431RC/BSP/Inc/sdmmc.h new file mode 100644 index 00000000..1bfdc09b --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Inc/sdmmc.h @@ -0,0 +1,58 @@ +/** + ****************************************************************************** + * File Name : SDMMC.h + * Description : This file provides code for the configuration + * of the SDMMC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __sdmmc_H +#define __sdmmc_H +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern SD_HandleTypeDef hsd1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_SDMMC1_SD_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ sdmmc_H */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/BearPi_STM32L431RC/BSP/Inc/stm32l4xx_hal_conf.h b/board/BearPi_STM32L431RC/BSP/Inc/stm32l4xx_hal_conf.h index e75091c5..d825554f 100644 --- a/board/BearPi_STM32L431RC/BSP/Inc/stm32l4xx_hal_conf.h +++ b/board/BearPi_STM32L431RC/BSP/Inc/stm32l4xx_hal_conf.h @@ -78,11 +78,11 @@ /*#define HAL_OSPI_MODULE_ENABLED */ /*#define HAL_PCD_MODULE_ENABLED */ /*#define HAL_QSPI_MODULE_ENABLED */ -/*#define HAL_QSPI_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED /*#define HAL_RNG_MODULE_ENABLED */ /*#define HAL_RTC_MODULE_ENABLED */ /*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SD_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED /*#define HAL_SMBUS_MODULE_ENABLED */ /*#define HAL_SMARTCARD_MODULE_ENABLED */ #define HAL_SPI_MODULE_ENABLED diff --git a/board/BearPi_STM32L431RC/BSP/Src/mcu_init.c b/board/BearPi_STM32L431RC/BSP/Src/mcu_init.c index 7787f2e5..e0c1a37c 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/mcu_init.c +++ b/board/BearPi_STM32L431RC/BSP/Src/mcu_init.c @@ -103,21 +103,24 @@ void SystemClock_Config(void) { Error_Handler(); } - PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2|RCC_PERIPHCLK_USART3 - |RCC_PERIPHCLK_LPUART1|RCC_PERIPHCLK_I2C1 + PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_USART2 + |RCC_PERIPHCLK_USART3|RCC_PERIPHCLK_LPUART1 + |RCC_PERIPHCLK_I2C1|RCC_PERIPHCLK_SDMMC1 |RCC_PERIPHCLK_ADC; + PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2; PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1; PeriphClkInit.Usart3ClockSelection = RCC_USART3CLKSOURCE_PCLK1; PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1; PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1; PeriphClkInit.AdcClockSelection = RCC_ADCCLKSOURCE_PLLSAI1; + PeriphClkInit.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_PLLSAI1; PeriphClkInit.PLLSAI1.PLLSAI1Source = RCC_PLLSOURCE_MSI; PeriphClkInit.PLLSAI1.PLLSAI1M = 1; PeriphClkInit.PLLSAI1.PLLSAI1N = 16; PeriphClkInit.PLLSAI1.PLLSAI1P = RCC_PLLP_DIV7; PeriphClkInit.PLLSAI1.PLLSAI1Q = RCC_PLLQ_DIV2; PeriphClkInit.PLLSAI1.PLLSAI1R = RCC_PLLR_DIV2; - PeriphClkInit.PLLSAI1.PLLSAI1ClockOut = RCC_PLLSAI1_ADC1CLK; + PeriphClkInit.PLLSAI1.PLLSAI1ClockOut = RCC_PLLSAI1_48M2CLK|RCC_PLLSAI1_ADC1CLK; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); diff --git a/board/BearPi_STM32L431RC/BSP/Src/quadspi.c b/board/BearPi_STM32L431RC/BSP/Src/quadspi.c new file mode 100644 index 00000000..e0033a86 --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Src/quadspi.c @@ -0,0 +1,110 @@ +/** + ****************************************************************************** + * File Name : QUADSPI.c + * Description : This file provides code for the configuration + * of the QUADSPI instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "quadspi.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +QSPI_HandleTypeDef hqspi; + +/* QUADSPI init function */ +void MX_QUADSPI_Init(void) +{ + + hqspi.Instance = QUADSPI; + hqspi.Init.ClockPrescaler = 0; + hqspi.Init.FifoThreshold = 4; + hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE; + hqspi.Init.FlashSize = 22; + hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_4_CYCLE; + hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0; + hqspi.Init.FlashID = QSPI_FLASH_ID_1; + hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE; + if (HAL_QSPI_Init(&hqspi) != HAL_OK) + { + Error_Handler(); + } + +} + +void HAL_QSPI_MspInit(QSPI_HandleTypeDef* qspiHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(qspiHandle->Instance==QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspInit 0 */ + + /* USER CODE END QUADSPI_MspInit 0 */ + /* QUADSPI clock enable */ + __HAL_RCC_QSPI_CLK_ENABLE(); + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**QUADSPI GPIO Configuration + PB0 ------> QUADSPI_BK1_IO1 + PB1 ------> QUADSPI_BK1_IO0 + PB10 ------> QUADSPI_CLK + PB11 ------> QUADSPI_BK1_NCS + */ + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN QUADSPI_MspInit 1 */ + + /* USER CODE END QUADSPI_MspInit 1 */ + } +} + +void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef* qspiHandle) +{ + + if(qspiHandle->Instance==QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspDeInit 0 */ + + /* USER CODE END QUADSPI_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_QSPI_CLK_DISABLE(); + + /**QUADSPI GPIO Configuration + PB0 ------> QUADSPI_BK1_IO1 + PB1 ------> QUADSPI_BK1_IO0 + PB10 ------> QUADSPI_CLK + PB11 ------> QUADSPI_BK1_NCS + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11); + + /* USER CODE BEGIN QUADSPI_MspDeInit 1 */ + + /* USER CODE END QUADSPI_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/BearPi_STM32L431RC/BSP/Src/sdmmc.c b/board/BearPi_STM32L431RC/BSP/Src/sdmmc.c new file mode 100644 index 00000000..47745ea5 --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Src/sdmmc.c @@ -0,0 +1,117 @@ +/** + ****************************************************************************** + * File Name : SDMMC.c + * Description : This file provides code for the configuration + * of the SDMMC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "sdmmc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +SD_HandleTypeDef hsd1; + +/* SDMMC1 init function */ + +void MX_SDMMC1_SD_Init(void) +{ + + hsd1.Instance = SDMMC1; + hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; + hsd1.Init.ClockBypass = SDMMC_CLOCK_BYPASS_DISABLE; + hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; + hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B; + hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; + hsd1.Init.ClockDiv = 0; + if (HAL_SD_Init(&hsd1) != HAL_OK) + { + Error_Handler(); + } + +} + +void HAL_SD_MspInit(SD_HandleTypeDef* sdHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(sdHandle->Instance==SDMMC1) + { + /* USER CODE BEGIN SDMMC1_MspInit 0 */ + + /* USER CODE END SDMMC1_MspInit 0 */ + /* SDMMC1 clock enable */ + __HAL_RCC_SDMMC1_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + /**SDMMC1 GPIO Configuration + PC8 ------> SDMMC1_D0 + PC12 ------> SDMMC1_CK + PD2 ------> SDMMC1_CMD + */ + GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_12; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_2; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + /* USER CODE BEGIN SDMMC1_MspInit 1 */ + + /* USER CODE END SDMMC1_MspInit 1 */ + } +} + +void HAL_SD_MspDeInit(SD_HandleTypeDef* sdHandle) +{ + + if(sdHandle->Instance==SDMMC1) + { + /* USER CODE BEGIN SDMMC1_MspDeInit 0 */ + + /* USER CODE END SDMMC1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SDMMC1_CLK_DISABLE(); + + /**SDMMC1 GPIO Configuration + PC8 ------> SDMMC1_D0 + PC12 ------> SDMMC1_CK + PD2 ------> SDMMC1_CMD + */ + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_8|GPIO_PIN_12); + + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2); + + /* USER CODE BEGIN SDMMC1_MspDeInit 1 */ + + /* USER CODE END SDMMC1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_mpy.c b/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_mpy.c new file mode 100644 index 00000000..78cb75af --- /dev/null +++ b/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_mpy.c @@ -0,0 +1,360 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32l4xx_it.c + * @brief Interrupt Service Routines. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "stm32l4xx_it.h" +#include "tos_k.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#include "machine_uart.h" +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* External variables --------------------------------------------------------*/ +extern UART_HandleTypeDef hlpuart1; +extern UART_HandleTypeDef huart2; +extern UART_HandleTypeDef huart3; +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/******************************************************************************/ +/* Cortex-M4 Processor Interruption and Exception Handlers */ +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + + /* USER CODE END NonMaskableInt_IRQn 1 */ +} + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} + +/** + * @brief This function handles Prefetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } +} + +/** + * @brief This function handles System service call via SWI instruction. + */ +void SVC_Handler(void) +{ + /* USER CODE BEGIN SVCall_IRQn 0 */ + + /* USER CODE END SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 1 */ + + /* USER CODE END SVCall_IRQn 1 */ +} + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + +/** + * @brief This function handles Pendable request for system service. + */ +__weak void PendSV_Handler(void) +{ + /* USER CODE BEGIN PendSV_IRQn 0 */ + + /* USER CODE END PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 1 */ + + /* USER CODE END PendSV_IRQn 1 */ +} + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + HAL_IncTick(); + if (tos_knl_is_running()) + { + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); + } + //HAL_SYSTICK_IRQHandler(); + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + +/******************************************************************************/ +/* STM32L4xx Peripheral Interrupt Handlers */ +/* Add here the Interrupt Handlers for the used peripherals. */ +/* For the available peripheral interrupt handler names, */ +/* please refer to the startup file (startup_stm32l4xx.s). */ +/******************************************************************************/ + +/** + * @brief This function handles EXTI line1 interrupt. + */ +void EXTI1_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI1_IRQn 0 */ + + /* USER CODE END EXTI1_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1); + /* USER CODE BEGIN EXTI1_IRQn 1 */ + + /* USER CODE END EXTI1_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line2 interrupt. + */ +void EXTI2_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI2_IRQn 0 */ + + /* USER CODE END EXTI2_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_2); + /* USER CODE BEGIN EXTI2_IRQn 1 */ + + /* USER CODE END EXTI2_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line3 interrupt. + */ +void EXTI3_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI3_IRQn 0 */ + + /* USER CODE END EXTI3_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3); + /* USER CODE BEGIN EXTI3_IRQn 1 */ + + /* USER CODE END EXTI3_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line4 interrupt. + */ +void EXTI4_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI4_IRQn 0 */ + + /* USER CODE END EXTI4_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); + /* USER CODE BEGIN EXTI4_IRQn 1 */ + + /* USER CODE END EXTI4_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line[9:5] interrupts. + */ +void EXTI9_5_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI9_5_IRQn 0 */ + + /* USER CODE END EXTI9_5_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_6); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_7); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_9); + /* USER CODE BEGIN EXTI9_5_IRQn 1 */ + + /* USER CODE END EXTI9_5_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line[15:10] interrupts. + */ +void EXTI15_10_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI15_10_IRQn 0 */ + + /* USER CODE END EXTI15_10_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_12); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_14); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_15); + /* USER CODE BEGIN EXTI15_10_IRQn 1 */ + + /* USER CODE END EXTI15_10_IRQn 1 */ +} + +/** + * @brief This function handles USART2 global interrupt. + */ +void USART2_IRQHandler(void) +{ + /* USER CODE BEGIN USART2_IRQn 0 */ + + /* USER CODE END USART2_IRQn 0 */ + HAL_UART_IRQHandler(&huart2); + /* USER CODE BEGIN USART2_IRQn 1 */ + + /* USER CODE END USART2_IRQn 1 */ +} + +/** + * @brief This function handles USART3 global interrupt. + */ +void USART3_IRQHandler(void) +{ + /* USER CODE BEGIN USART3_IRQn 0 */ + + /* USER CODE END USART3_IRQn 0 */ + HAL_UART_IRQHandler(&huart3); + /* USER CODE BEGIN USART3_IRQn 1 */ + + /* USER CODE END USART3_IRQn 1 */ +} + +/** + * @brief This function handles LPUART1 global interrupt. + */ +void LPUART1_IRQHandler(void) +{ + /* USER CODE BEGIN LPUART1_IRQn 0 */ + + /* USER CODE END LPUART1_IRQn 0 */ + HAL_UART_IRQHandler(&hlpuart1); + /* USER CODE BEGIN LPUART1_IRQn 1 */ + + /* USER CODE END LPUART1_IRQn 1 */ +} + +/* USER CODE BEGIN 1 */ +void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) +{ + if (huart->Instance == LPUART1) { + mp_hal_uart_irq_handler(0); + } else if (huart->Instance == USART1) { + mp_hal_uart_irq_handler(1); + } else if (huart->Instance == USART2) { + mp_hal_uart_irq_handler(2); + } else if (huart->Instance == USART3) { + mp_hal_uart_irq_handler(3); + } +} +/* USER CODE END 1 */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/BearPi_STM32L431RC/BSP/Src/usart.c b/board/BearPi_STM32L431RC/BSP/Src/usart.c index c6353adf..794e1dcc 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/usart.c +++ b/board/BearPi_STM32L431RC/BSP/Src/usart.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN 0 */ uint8_t data; uint8_t shell_data; +extern void mp_hal_uart_rx_start(uint32_t uart_id); /* USER CODE END 0 */ UART_HandleTypeDef hlpuart1; @@ -49,10 +50,14 @@ void MX_LPUART1_UART_Init(void) { Error_Handler(); } - HAL_UART_Receive_IT(&hlpuart1, &data, 1); +#ifdef USE_MICROPYTHON + mp_hal_uart_rx_start(0); +#else + HAL_UART_Receive_IT(&hlpuart1, &data, 1); #if AT_INPUT_TYPE_FRAME_EN __HAL_UART_ENABLE_IT(&hlpuart1, UART_IT_IDLE); #endif +#endif } /* USART1 init function */ @@ -73,6 +78,9 @@ void MX_USART1_UART_Init(void) { Error_Handler(); } +#ifdef USE_MICROPYTHON + mp_hal_uart_rx_start(1); +#endif } /* USART2 init function */ @@ -93,7 +101,11 @@ void MX_USART2_UART_Init(void) { Error_Handler(); } +#ifdef USE_MICROPYTHON + mp_hal_uart_rx_start(2); +#else HAL_UART_Receive_IT(&huart2, &shell_data, 1); +#endif } /* USART3 init function */ @@ -114,7 +126,9 @@ void MX_USART3_UART_Init(void) { Error_Handler(); } - +#ifdef USE_MICROPYTHON + mp_hal_uart_rx_start(3); +#endif } void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) diff --git a/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/BearPi_STM32L31RC.uvoptx b/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/BearPi_STM32L31RC.uvoptx new file mode 100644 index 00000000..47b29653 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/BearPi_STM32L31RC.uvoptx @@ -0,0 +1,1380 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O10446 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) + + + + + 0 + 0 + 245 + 1 +
134228264
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + \\TencentOS_tiny\../../../../arch/arm/arm-v7m/common/tos_cpu.c\245 +
+ + 1 + 0 + 251 + 1 +
134228282
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + \\TencentOS_tiny\../../../../arch/arm/arm-v7m/common/tos_cpu.c\251 +
+
+ + + 0 + 1 + tos_next_task + + + 1 + 1 + tos_rdyq.highest_prio + + + 2 + 1 + task_list + + + 3 + 1 + 0x20000280 + + + 4 + 1 + tos_rdyq.highest_prio + + + 5 + 1 + owner + + + 6 + 1 + tos_curr_task + + + 7 + 1 + highest_pending_prio + + + 8 + 1 + task + + + + + 1 + 0 + 0x200016F4 + 0 + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 0 + 0 + 2 + 10000000 + +
+
+ + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 1 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it.c + stm32l4xx_it.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\sdmmc.c + sdmmc.c + 0 + 0 + + + + + examples + 0 + 0 + 0 + 0 + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\fatfs_through_vfs\fatfs_through_vfs_sample.c + fatfs_through_vfs_sample.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + stm32l4xx_hal_sd.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + stm32l4xx_hal_sd_ex.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + stm32l4xx_ll_sdmmc.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 40 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 41 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\BH1750\BH1750.c + BH1750.c + 0 + 0 + + + 6 + 42 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c + lcd_spi2_drv.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 43 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 44 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 8 + 67 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 8 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 8 + 69 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + config + 0 + 0 + 0 + 0 + + 9 + 70 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + fatfs + 0 + 0 + 0 + 0 + + 10 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + tos_diskio.c + 0 + 0 + + + 10 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + tos_fatfs_drv.c + 0 + 0 + + + 10 + 73 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + tos_fatfs_vfs.c + 0 + 0 + + + 10 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + tos_ff.c + 0 + 0 + + + 10 + 75 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + tos_ffsystem.c + 0 + 0 + + + 10 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + tos_ffunicode.c + 0 + 0 + + + + + vfs + 0 + 0 + 0 + 0 + + 11 + 77 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs.c + tos_vfs.c + 0 + 0 + + + 11 + 78 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + tos_vfs_device.c + 0 + 0 + + + 11 + 79 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + tos_vfs_file.c + 0 + 0 + + + 11 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + tos_vfs_fs.c + 0 + 0 + + + 11 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + tos_vfs_inode.c + 0 + 0 + + + + + hal + 0 + 0 + 0 + 0 + + 12 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + tos_hal_sd.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/BearPi_STM32L31RC.uvprojx b/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/BearPi_STM32L31RC.uvprojx new file mode 100644 index 00000000..963c969d --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/BearPi_STM32L31RC.uvprojx @@ -0,0 +1,872 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.2.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4107 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266 + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\BSP\Hardware\LCD_ST7789;..\..\BSP\Hardware\BH1750;..\..\..\..\examples\fatfs_through_vfs;..\..\..\..\components\fs\vfs\include;..\..\..\..\components\fs\fatfs\wrapper\include;..\..\..\..\components\fs\fatfs\3rdparty + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + stm32l4xx_it.c + 1 + ..\..\BSP\Src\stm32l4xx_it.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + sdmmc.c + 1 + ..\..\BSP\Src\sdmmc.c + + + + + examples + + + fatfs_through_vfs_sample.c + 1 + ..\..\..\..\examples\fatfs_through_vfs\fatfs_through_vfs_sample.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + stm32l4xx_hal_sd.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + + + stm32l4xx_hal_sd_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + + + stm32l4xx_ll_sdmmc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + BH1750.c + 1 + ..\..\BSP\Hardware\BH1750\BH1750.c + + + lcd_spi2_drv.c + 1 + ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c + + + + + kernel + + + tos_mmblk.c + 1 + ..\..\..\..\kernel\core\tos_mmblk.c + + + tos_mmheap.c + 1 + ..\..\..\..\kernel\core\tos_mmheap.c + + + tos_mutex.c + 1 + ..\..\..\..\kernel\core\tos_mutex.c + + + tos_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.c + + + tos_sys.c + 1 + ..\..\..\..\kernel\core\tos_sys.c + + + tos_task.c + 1 + ..\..\..\..\kernel\core\tos_task.c + + + tos_tick.c + 1 + ..\..\..\..\kernel\core\tos_tick.c + + + tos_time.c + 1 + ..\..\..\..\kernel\core\tos_time.c + + + tos_timer.c + 1 + ..\..\..\..\kernel\core\tos_timer.c + + + tos_event.c + 1 + ..\..\..\..\kernel\core\tos_event.c + + + tos_global.c + 1 + ..\..\..\..\kernel\core\tos_global.c + + + tos_pend.c + 1 + ..\..\..\..\kernel\core\tos_pend.c + + + tos_robin.c + 1 + ..\..\..\..\kernel\core\tos_robin.c + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.c + + + tos_char_fifo.c + 1 + ..\..\..\..\kernel\core\tos_char_fifo.c + + + tos_completion.c + 1 + ..\..\..\..\kernel\core\tos_completion.c + + + tos_countdownlatch.c + 1 + ..\..\..\..\kernel\core\tos_countdownlatch.c + + + tos_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_mail_queue.c + + + tos_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_message_queue.c + + + tos_priority_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + + + tos_priority_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + + + tos_priority_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_queue.c + + + tos_ring_queue.c + 1 + ..\..\..\..\kernel\core\tos_ring_queue.c + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + tos_cpu.c + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + + port_c.c + 1 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + fatfs + + + tos_diskio.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + + + tos_fatfs_drv.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + + + tos_fatfs_vfs.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + + + tos_ff.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + + + tos_ffsystem.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + + + tos_ffunicode.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + + + + + vfs + + + tos_vfs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs.c + + + tos_vfs_device.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + + + tos_vfs_file.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + + + tos_vfs_fs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + + + tos_vfs_inode.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + + + + + hal + + + tos_hal_sd.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/startup_stm32l431xx.s b/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/startup_stm32l431xx.s new file mode 100644 index 00000000..6a5c15a5 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/fatfs_through_vfs/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power devices vector table for MDK-ARM toolchain. +;* This module performs: +;* - Set the initial SP +;* - Set the initial PC == Reset_Handler +;* - Set the vector table entries with the exceptions ISR address +;* - Branches to __main in the C library (which eventually +;* calls main()). +;* After Reset the Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; Amount of memory (in bytes) allocated for Stack +; Tailor this value to your application needs +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x100 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x100 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDG_IRQHandler ; Window WatchDog + DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS interrupt + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +; Reset handler +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_PVM_IRQHandler [WEAK] + EXPORT TAMP_STAMP_IRQHandler [WEAK] + EXPORT RTC_WKUP_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT RCC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT DMA1_Channel5_IRQHandler [WEAK] + EXPORT DMA1_Channel6_IRQHandler [WEAK] + EXPORT DMA1_Channel7_IRQHandler [WEAK] + EXPORT ADC1_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT I2C2_EV_IRQHandler [WEAK] + EXPORT I2C2_ER_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_IRQHandler [WEAK] + EXPORT DMA2_Channel1_IRQHandler [WEAK] + EXPORT DMA2_Channel2_IRQHandler [WEAK] + EXPORT DMA2_Channel3_IRQHandler [WEAK] + EXPORT DMA2_Channel4_IRQHandler [WEAK] + EXPORT DMA2_Channel5_IRQHandler [WEAK] + EXPORT COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_IRQHandler +RTC_WKUP_IRQHandler +FLASH_IRQHandler +RCC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +DMA1_Channel5_IRQHandler +DMA1_Channel6_IRQHandler +DMA1_Channel7_IRQHandler +ADC1_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_IRQHandler + + B . + + ENDP + + ALIGN + +;******************************************************************************* +; User Stack and Heap initialization +;******************************************************************************* + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + END + +;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/BearPi_STM32L31RC.uvoptx b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/BearPi_STM32L31RC.uvoptx new file mode 100644 index 00000000..61b73046 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/BearPi_STM32L31RC.uvoptx @@ -0,0 +1,2923 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O10446 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) + + + + + + 0 + 1 + tos_next_task + + + 1 + 1 + tos_rdyq.highest_prio + + + 2 + 1 + task_list + + + 3 + 1 + 0x20000280 + + + 4 + 1 + tos_rdyq.highest_prio + + + 5 + 1 + owner + + + 6 + 1 + tos_curr_task + + + 7 + 1 + highest_pending_prio + + + 8 + 1 + task + + + + + 1 + 0 + 0x200016F4 + 0 + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 0 + 0 + 2 + 10000000 + + + + + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 0 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it_mpy.c + stm32l4xx_it_mpy.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + + + examples + 0 + 0 + 0 + 0 + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\micropython_demo\micropython_demo.c + micropython_demo.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 36 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 37 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\BH1750\BH1750.c + BH1750.c + 0 + 0 + + + 6 + 38 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c + lcd_spi2_drv.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 39 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 40 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 41 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 42 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 43 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 44 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + + + hal + 0 + 0 + 0 + 0 + + 8 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_uart.c + tos_hal_uart.c + 0 + 0 + + + 8 + 64 + 1 + 0 + 0 + 0 + .\board\hal\mp_tos_hal_pin.c + mp_tos_hal_pin.c + 0 + 0 + + + 8 + 65 + 1 + 0 + 0 + 0 + .\board\hal\mp_tos_hal_spi.c + mp_tos_hal_spi.c + 0 + 0 + + + 8 + 66 + 1 + 0 + 0 + 0 + .\board\hal\mp_tos_hal_uart.c + mp_tos_hal_uart.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 9 + 67 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 9 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 9 + 69 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + config + 0 + 0 + 0 + 0 + + 10 + 70 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + micropython/py + 0 + 0 + 0 + 0 + + 11 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\argcheck.c + argcheck.c + 0 + 0 + + + 11 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmarm.c + asmarm.c + 0 + 0 + + + 11 + 73 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmbase.c + asmbase.c + 0 + 0 + + + 11 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmthumb.c + asmthumb.c + 0 + 0 + + + 11 + 75 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmx64.c + asmx64.c + 0 + 0 + + + 11 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmx86.c + asmx86.c + 0 + 0 + + + 11 + 77 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmxtensa.c + asmxtensa.c + 0 + 0 + + + 11 + 78 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\bc.c + bc.c + 0 + 0 + + + 11 + 79 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\binary.c + binary.c + 0 + 0 + + + 11 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\builtinevex.c + builtinevex.c + 0 + 0 + + + 11 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\builtinhelp.c + builtinhelp.c + 0 + 0 + + + 11 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\builtinimport.c + builtinimport.c + 0 + 0 + + + 11 + 83 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\compile.c + compile.c + 0 + 0 + + + 11 + 84 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitbc.c + emitbc.c + 0 + 0 + + + 11 + 85 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitcommon.c + emitcommon.c + 0 + 0 + + + 11 + 86 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitglue.c + emitglue.c + 0 + 0 + + + 11 + 87 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitinlinethumb.c + emitinlinethumb.c + 0 + 0 + + + 11 + 88 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitinlinextensa.c + emitinlinextensa.c + 0 + 0 + + + 11 + 89 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnarm.c + emitnarm.c + 0 + 0 + + + 11 + 90 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnative.c + emitnative.c + 0 + 0 + + + 11 + 91 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnthumb.c + emitnthumb.c + 0 + 0 + + + 11 + 92 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnx64.c + emitnx64.c + 0 + 0 + + + 11 + 93 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnx86.c + emitnx86.c + 0 + 0 + + + 11 + 94 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnxtensa.c + emitnxtensa.c + 0 + 0 + + + 11 + 95 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnxtensawin.c + emitnxtensawin.c + 0 + 0 + + + 11 + 96 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\formatfloat.c + formatfloat.c + 0 + 0 + + + 11 + 97 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\frozenmod.c + frozenmod.c + 0 + 0 + + + 11 + 98 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\gc.c + gc.c + 0 + 0 + + + 11 + 99 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\lexer.c + lexer.c + 0 + 0 + + + 11 + 100 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\malloc.c + malloc.c + 0 + 0 + + + 11 + 101 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\map.c + map.c + 0 + 0 + + + 11 + 102 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modarray.c + modarray.c + 0 + 0 + + + 11 + 103 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modbuiltins.c + modbuiltins.c + 0 + 0 + + + 11 + 104 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modcmath.c + modcmath.c + 0 + 0 + + + 11 + 105 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modcollections.c + modcollections.c + 0 + 0 + + + 11 + 106 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modgc.c + modgc.c + 0 + 0 + + + 11 + 107 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modio.c + modio.c + 0 + 0 + + + 11 + 108 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modmath.c + modmath.c + 0 + 0 + + + 11 + 109 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modmicropython.c + modmicropython.c + 0 + 0 + + + 11 + 110 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modstruct.c + modstruct.c + 0 + 0 + + + 11 + 111 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modsys.c + modsys.c + 0 + 0 + + + 11 + 112 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modthread.c + modthread.c + 0 + 0 + + + 11 + 113 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\moduerrno.c + moduerrno.c + 0 + 0 + + + 11 + 114 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\mpprint.c + mpprint.c + 0 + 0 + + + 11 + 115 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\mpstate.c + mpstate.c + 0 + 0 + + + 11 + 116 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\mpz.c + mpz.c + 0 + 0 + + + 11 + 117 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nativeglue.c + nativeglue.c + 0 + 0 + + + 11 + 118 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlr.c + nlr.c + 0 + 0 + + + 11 + 119 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlraarch64.c + nlraarch64.c + 0 + 0 + + + 11 + 120 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrpowerpc.c + nlrpowerpc.c + 0 + 0 + + + 11 + 121 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrsetjmp.c + nlrsetjmp.c + 0 + 0 + + + 11 + 122 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrthumb.c + nlrthumb.c + 0 + 0 + + + 11 + 123 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrx64.c + nlrx64.c + 0 + 0 + + + 11 + 124 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrx86.c + nlrx86.c + 0 + 0 + + + 11 + 125 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrxtensa.c + nlrxtensa.c + 0 + 0 + + + 11 + 126 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\obj.c + obj.c + 0 + 0 + + + 11 + 127 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objarray.c + objarray.c + 0 + 0 + + + 11 + 128 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objattrtuple.c + objattrtuple.c + 0 + 0 + + + 11 + 129 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objbool.c + objbool.c + 0 + 0 + + + 11 + 130 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objboundmeth.c + objboundmeth.c + 0 + 0 + + + 11 + 131 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objcell.c + objcell.c + 0 + 0 + + + 11 + 132 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objclosure.c + objclosure.c + 0 + 0 + + + 11 + 133 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objcomplex.c + objcomplex.c + 0 + 0 + + + 11 + 134 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objdeque.c + objdeque.c + 0 + 0 + + + 11 + 135 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objdict.c + objdict.c + 0 + 0 + + + 11 + 136 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objenumerate.c + objenumerate.c + 0 + 0 + + + 11 + 137 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objexcept.c + objexcept.c + 0 + 0 + + + 11 + 138 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objfilter.c + objfilter.c + 0 + 0 + + + 11 + 139 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objfloat.c + objfloat.c + 0 + 0 + + + 11 + 140 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objfun.c + objfun.c + 0 + 0 + + + 11 + 141 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objgenerator.c + objgenerator.c + 0 + 0 + + + 11 + 142 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objgetitemiter.c + objgetitemiter.c + 0 + 0 + + + 11 + 143 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objint.c + objint.c + 0 + 0 + + + 11 + 144 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objint_longlong.c + objint_longlong.c + 0 + 0 + + + 11 + 145 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objint_mpz.c + objint_mpz.c + 0 + 0 + + + 11 + 146 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objlist.c + objlist.c + 0 + 0 + + + 11 + 147 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objmap.c + objmap.c + 0 + 0 + + + 11 + 148 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objmodule.c + objmodule.c + 0 + 0 + + + 11 + 149 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objnamedtuple.c + objnamedtuple.c + 0 + 0 + + + 11 + 150 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objnone.c + objnone.c + 0 + 0 + + + 11 + 151 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objobject.c + objobject.c + 0 + 0 + + + 11 + 152 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objpolyiter.c + objpolyiter.c + 0 + 0 + + + 11 + 153 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objproperty.c + objproperty.c + 0 + 0 + + + 11 + 154 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objrange.c + objrange.c + 0 + 0 + + + 11 + 155 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objreversed.c + objreversed.c + 0 + 0 + + + 11 + 156 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objset.c + objset.c + 0 + 0 + + + 11 + 157 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objsingleton.c + objsingleton.c + 0 + 0 + + + 11 + 158 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objslice.c + objslice.c + 0 + 0 + + + 11 + 159 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objstr.c + objstr.c + 0 + 0 + + + 11 + 160 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objstringio.c + objstringio.c + 0 + 0 + + + 11 + 161 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objstrunicode.c + objstrunicode.c + 0 + 0 + + + 11 + 162 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objtuple.c + objtuple.c + 0 + 0 + + + 11 + 163 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objtype.c + objtype.c + 0 + 0 + + + 11 + 164 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objzip.c + objzip.c + 0 + 0 + + + 11 + 165 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\opmethods.c + opmethods.c + 0 + 0 + + + 11 + 166 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\pairheap.c + pairheap.c + 0 + 0 + + + 11 + 167 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\parse.c + parse.c + 0 + 0 + + + 11 + 168 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\parsenum.c + parsenum.c + 0 + 0 + + + 11 + 169 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\parsenumbase.c + parsenumbase.c + 0 + 0 + + + 11 + 170 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\persistentcode.c + persistentcode.c + 0 + 0 + + + 11 + 171 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\profile.c + profile.c + 0 + 0 + + + 11 + 172 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\pystack.c + pystack.c + 0 + 0 + + + 11 + 173 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\qstr.c + qstr.c + 0 + 0 + + + 11 + 174 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\reader.c + reader.c + 0 + 0 + + + 11 + 175 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\repl.c + repl.c + 0 + 0 + + + 11 + 176 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\ringbuf.c + ringbuf.c + 0 + 0 + + + 11 + 177 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\runtime.c + runtime.c + 0 + 0 + + + 11 + 178 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\runtime_utils.c + runtime_utils.c + 0 + 0 + + + 11 + 179 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\scheduler.c + scheduler.c + 0 + 0 + + + 11 + 180 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\scope.c + scope.c + 0 + 0 + + + 11 + 181 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\sequence.c + sequence.c + 0 + 0 + + + 11 + 182 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\showbc.c + showbc.c + 0 + 0 + + + 11 + 183 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\smallint.c + smallint.c + 0 + 0 + + + 11 + 184 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\stackctrl.c + stackctrl.c + 0 + 0 + + + 11 + 185 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\stream.c + stream.c + 0 + 0 + + + 11 + 186 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\unicode.c + unicode.c + 0 + 0 + + + 11 + 187 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\vm.c + vm.c + 0 + 0 + + + 11 + 188 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\vstr.c + vstr.c + 0 + 0 + + + 11 + 189 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\warning.c + warning.c + 0 + 0 + + + + + micropython/shared + 0 + 0 + 0 + 0 + + 12 + 190 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\readline\readline.c + readline.c + 0 + 0 + + + 12 + 191 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\pyexec.c + pyexec.c + 0 + 0 + + + 12 + 192 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\sys_stdio_mphal.c + sys_stdio_mphal.c + 0 + 0 + + + 12 + 193 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\interrupt_char.c + interrupt_char.c + 0 + 0 + + + 12 + 194 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\stdout_helpers.c + stdout_helpers.c + 0 + 0 + + + + + micropython/extmod + 0 + 0 + 0 + 0 + + 13 + 195 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\utime_mphal.c + utime_mphal.c + 0 + 0 + + + 13 + 196 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\machine_signal.c + machine_signal.c + 0 + 0 + + + 13 + 197 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\virtpin.c + virtpin.c + 0 + 0 + + + 13 + 198 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\machine_mem.c + machine_mem.c + 0 + 0 + + + + + micropython/port + 0 + 0 + 0 + 0 + + 14 + 199 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\help.c + help.c + 0 + 0 + + + 14 + 200 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\mphalport.c + mphalport.c + 0 + 0 + + + 14 + 201 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\mpmain.c + mpmain.c + 0 + 0 + + + 14 + 202 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\mpthreadport.c + mpthreadport.c + 0 + 0 + + + 14 + 203 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_hw_spi.c + machine_hw_spi.c + 0 + 0 + + + 14 + 204 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_pin.c + machine_pin.c + 0 + 0 + + + 14 + 205 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_timer.c + machine_timer.c + 0 + 0 + + + 14 + 206 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_uart.c + machine_uart.c + 0 + 0 + + + 14 + 207 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\modesp8266.c + modesp8266.c + 0 + 0 + + + 14 + 208 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\modmachine.c + modmachine.c + 0 + 0 + + + 14 + 209 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\modutime.c + modutime.c + 0 + 0 + + + 14 + 210 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos.c + vfs_tos.c + 0 + 0 + + + 14 + 211 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos_file.c + vfs_tos_file.c + 0 + 0 + + + 14 + 212 + 1 + 0 + 0 + 0 + .\board\mphalboard.c + mphalboard.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/BearPi_STM32L31RC.uvprojx b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/BearPi_STM32L31RC.uvprojx new file mode 100644 index 00000000..56bae191 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/BearPi_STM32L31RC.uvprojx @@ -0,0 +1,1532 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.2.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + cmd.exe /C cd $P..\..\..\..\components\language\micropython\port & make clean-build V=1 + cmd.exe /C cd $P..\..\..\..\components\language\micropython\port & make genhdr V=1 PYTHON=python PORT_BOARD_DIR=$Pboard TARGET_GENHDR_DIR=$Pgenhdr + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266,USE_MICROPYTHON + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\BSP\Hardware\LCD_ST7789;..\..\BSP\Hardware\BH1750;..\..\..\..\examples\micropython_demo;..\..\..\..\components\language\micropython;..\..\..\..\components\language\micropython\port;..\..\..\..\components\language\micropython\port\modules;..\micropython_basic_demo;.\board;.\board\hal + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + stm32l4xx_it_mpy.c + 1 + ..\..\BSP\Src\stm32l4xx_it_mpy.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + + + examples + + + micropython_demo.c + 1 + ..\..\..\..\examples\micropython_demo\micropython_demo.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + BH1750.c + 1 + ..\..\BSP\Hardware\BH1750\BH1750.c + + + lcd_spi2_drv.c + 1 + ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c + + + + + kernel + + + tos_mmblk.c + 1 + ..\..\..\..\kernel\core\tos_mmblk.c + + + tos_mmheap.c + 1 + ..\..\..\..\kernel\core\tos_mmheap.c + + + tos_mutex.c + 1 + ..\..\..\..\kernel\core\tos_mutex.c + + + tos_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.c + + + tos_sys.c + 1 + ..\..\..\..\kernel\core\tos_sys.c + + + tos_task.c + 1 + ..\..\..\..\kernel\core\tos_task.c + + + tos_tick.c + 1 + ..\..\..\..\kernel\core\tos_tick.c + + + tos_time.c + 1 + ..\..\..\..\kernel\core\tos_time.c + + + tos_timer.c + 1 + ..\..\..\..\kernel\core\tos_timer.c + + + tos_event.c + 1 + ..\..\..\..\kernel\core\tos_event.c + + + tos_global.c + 1 + ..\..\..\..\kernel\core\tos_global.c + + + tos_pend.c + 1 + ..\..\..\..\kernel\core\tos_pend.c + + + tos_robin.c + 1 + ..\..\..\..\kernel\core\tos_robin.c + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.c + + + tos_char_fifo.c + 1 + ..\..\..\..\kernel\core\tos_char_fifo.c + + + tos_completion.c + 1 + ..\..\..\..\kernel\core\tos_completion.c + + + tos_countdownlatch.c + 1 + ..\..\..\..\kernel\core\tos_countdownlatch.c + + + tos_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_mail_queue.c + + + tos_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_message_queue.c + + + tos_priority_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + + + tos_priority_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + + + tos_priority_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_queue.c + + + tos_ring_queue.c + 1 + ..\..\..\..\kernel\core\tos_ring_queue.c + + + + + hal + + + tos_hal_uart.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_uart.c + + + mp_tos_hal_pin.c + 1 + .\board\hal\mp_tos_hal_pin.c + + + mp_tos_hal_spi.c + 1 + .\board\hal\mp_tos_hal_spi.c + + + mp_tos_hal_uart.c + 1 + .\board\hal\mp_tos_hal_uart.c + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + tos_cpu.c + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + + port_c.c + 1 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + micropython/py + + + argcheck.c + 1 + ..\..\..\..\components\language\micropython\py\argcheck.c + + + asmarm.c + 1 + ..\..\..\..\components\language\micropython\py\asmarm.c + + + asmbase.c + 1 + ..\..\..\..\components\language\micropython\py\asmbase.c + + + asmthumb.c + 1 + ..\..\..\..\components\language\micropython\py\asmthumb.c + + + asmx64.c + 1 + ..\..\..\..\components\language\micropython\py\asmx64.c + + + asmx86.c + 1 + ..\..\..\..\components\language\micropython\py\asmx86.c + + + asmxtensa.c + 1 + ..\..\..\..\components\language\micropython\py\asmxtensa.c + + + bc.c + 1 + ..\..\..\..\components\language\micropython\py\bc.c + + + binary.c + 1 + ..\..\..\..\components\language\micropython\py\binary.c + + + builtinevex.c + 1 + ..\..\..\..\components\language\micropython\py\builtinevex.c + + + builtinhelp.c + 1 + ..\..\..\..\components\language\micropython\py\builtinhelp.c + + + builtinimport.c + 1 + ..\..\..\..\components\language\micropython\py\builtinimport.c + + + compile.c + 1 + ..\..\..\..\components\language\micropython\py\compile.c + + + emitbc.c + 1 + ..\..\..\..\components\language\micropython\py\emitbc.c + + + emitcommon.c + 1 + ..\..\..\..\components\language\micropython\py\emitcommon.c + + + emitglue.c + 1 + ..\..\..\..\components\language\micropython\py\emitglue.c + + + emitinlinethumb.c + 1 + ..\..\..\..\components\language\micropython\py\emitinlinethumb.c + + + emitinlinextensa.c + 1 + ..\..\..\..\components\language\micropython\py\emitinlinextensa.c + + + emitnarm.c + 1 + ..\..\..\..\components\language\micropython\py\emitnarm.c + + + emitnative.c + 1 + ..\..\..\..\components\language\micropython\py\emitnative.c + + + emitnthumb.c + 1 + ..\..\..\..\components\language\micropython\py\emitnthumb.c + + + emitnx64.c + 1 + ..\..\..\..\components\language\micropython\py\emitnx64.c + + + emitnx86.c + 1 + ..\..\..\..\components\language\micropython\py\emitnx86.c + + + emitnxtensa.c + 1 + ..\..\..\..\components\language\micropython\py\emitnxtensa.c + + + emitnxtensawin.c + 1 + ..\..\..\..\components\language\micropython\py\emitnxtensawin.c + + + formatfloat.c + 1 + ..\..\..\..\components\language\micropython\py\formatfloat.c + + + frozenmod.c + 1 + ..\..\..\..\components\language\micropython\py\frozenmod.c + + + gc.c + 1 + ..\..\..\..\components\language\micropython\py\gc.c + + + lexer.c + 1 + ..\..\..\..\components\language\micropython\py\lexer.c + + + malloc.c + 1 + ..\..\..\..\components\language\micropython\py\malloc.c + + + map.c + 1 + ..\..\..\..\components\language\micropython\py\map.c + + + modarray.c + 1 + ..\..\..\..\components\language\micropython\py\modarray.c + + + modbuiltins.c + 1 + ..\..\..\..\components\language\micropython\py\modbuiltins.c + + + modcmath.c + 1 + ..\..\..\..\components\language\micropython\py\modcmath.c + + + modcollections.c + 1 + ..\..\..\..\components\language\micropython\py\modcollections.c + + + modgc.c + 1 + ..\..\..\..\components\language\micropython\py\modgc.c + + + modio.c + 1 + ..\..\..\..\components\language\micropython\py\modio.c + + + modmath.c + 1 + ..\..\..\..\components\language\micropython\py\modmath.c + + + modmicropython.c + 1 + ..\..\..\..\components\language\micropython\py\modmicropython.c + + + modstruct.c + 1 + ..\..\..\..\components\language\micropython\py\modstruct.c + + + modsys.c + 1 + ..\..\..\..\components\language\micropython\py\modsys.c + + + modthread.c + 1 + ..\..\..\..\components\language\micropython\py\modthread.c + + + moduerrno.c + 1 + ..\..\..\..\components\language\micropython\py\moduerrno.c + + + mpprint.c + 1 + ..\..\..\..\components\language\micropython\py\mpprint.c + + + mpstate.c + 1 + ..\..\..\..\components\language\micropython\py\mpstate.c + + + mpz.c + 1 + ..\..\..\..\components\language\micropython\py\mpz.c + + + nativeglue.c + 1 + ..\..\..\..\components\language\micropython\py\nativeglue.c + + + nlr.c + 1 + ..\..\..\..\components\language\micropython\py\nlr.c + + + nlraarch64.c + 1 + ..\..\..\..\components\language\micropython\py\nlraarch64.c + + + nlrpowerpc.c + 1 + ..\..\..\..\components\language\micropython\py\nlrpowerpc.c + + + nlrsetjmp.c + 1 + ..\..\..\..\components\language\micropython\py\nlrsetjmp.c + + + nlrthumb.c + 1 + ..\..\..\..\components\language\micropython\py\nlrthumb.c + + + nlrx64.c + 1 + ..\..\..\..\components\language\micropython\py\nlrx64.c + + + nlrx86.c + 1 + ..\..\..\..\components\language\micropython\py\nlrx86.c + + + nlrxtensa.c + 1 + ..\..\..\..\components\language\micropython\py\nlrxtensa.c + + + obj.c + 1 + ..\..\..\..\components\language\micropython\py\obj.c + + + objarray.c + 1 + ..\..\..\..\components\language\micropython\py\objarray.c + + + objattrtuple.c + 1 + ..\..\..\..\components\language\micropython\py\objattrtuple.c + + + objbool.c + 1 + ..\..\..\..\components\language\micropython\py\objbool.c + + + objboundmeth.c + 1 + ..\..\..\..\components\language\micropython\py\objboundmeth.c + + + objcell.c + 1 + ..\..\..\..\components\language\micropython\py\objcell.c + + + objclosure.c + 1 + ..\..\..\..\components\language\micropython\py\objclosure.c + + + objcomplex.c + 1 + ..\..\..\..\components\language\micropython\py\objcomplex.c + + + objdeque.c + 1 + ..\..\..\..\components\language\micropython\py\objdeque.c + + + objdict.c + 1 + ..\..\..\..\components\language\micropython\py\objdict.c + + + objenumerate.c + 1 + ..\..\..\..\components\language\micropython\py\objenumerate.c + + + objexcept.c + 1 + ..\..\..\..\components\language\micropython\py\objexcept.c + + + objfilter.c + 1 + ..\..\..\..\components\language\micropython\py\objfilter.c + + + objfloat.c + 1 + ..\..\..\..\components\language\micropython\py\objfloat.c + + + objfun.c + 1 + ..\..\..\..\components\language\micropython\py\objfun.c + + + objgenerator.c + 1 + ..\..\..\..\components\language\micropython\py\objgenerator.c + + + objgetitemiter.c + 1 + ..\..\..\..\components\language\micropython\py\objgetitemiter.c + + + objint.c + 1 + ..\..\..\..\components\language\micropython\py\objint.c + + + objint_longlong.c + 1 + ..\..\..\..\components\language\micropython\py\objint_longlong.c + + + objint_mpz.c + 1 + ..\..\..\..\components\language\micropython\py\objint_mpz.c + + + objlist.c + 1 + ..\..\..\..\components\language\micropython\py\objlist.c + + + objmap.c + 1 + ..\..\..\..\components\language\micropython\py\objmap.c + + + objmodule.c + 1 + ..\..\..\..\components\language\micropython\py\objmodule.c + + + objnamedtuple.c + 1 + ..\..\..\..\components\language\micropython\py\objnamedtuple.c + + + objnone.c + 1 + ..\..\..\..\components\language\micropython\py\objnone.c + + + objobject.c + 1 + ..\..\..\..\components\language\micropython\py\objobject.c + + + objpolyiter.c + 1 + ..\..\..\..\components\language\micropython\py\objpolyiter.c + + + objproperty.c + 1 + ..\..\..\..\components\language\micropython\py\objproperty.c + + + objrange.c + 1 + ..\..\..\..\components\language\micropython\py\objrange.c + + + objreversed.c + 1 + ..\..\..\..\components\language\micropython\py\objreversed.c + + + objset.c + 1 + ..\..\..\..\components\language\micropython\py\objset.c + + + objsingleton.c + 1 + ..\..\..\..\components\language\micropython\py\objsingleton.c + + + objslice.c + 1 + ..\..\..\..\components\language\micropython\py\objslice.c + + + objstr.c + 1 + ..\..\..\..\components\language\micropython\py\objstr.c + + + objstringio.c + 1 + ..\..\..\..\components\language\micropython\py\objstringio.c + + + objstrunicode.c + 1 + ..\..\..\..\components\language\micropython\py\objstrunicode.c + + + objtuple.c + 1 + ..\..\..\..\components\language\micropython\py\objtuple.c + + + objtype.c + 1 + ..\..\..\..\components\language\micropython\py\objtype.c + + + objzip.c + 1 + ..\..\..\..\components\language\micropython\py\objzip.c + + + opmethods.c + 1 + ..\..\..\..\components\language\micropython\py\opmethods.c + + + pairheap.c + 1 + ..\..\..\..\components\language\micropython\py\pairheap.c + + + parse.c + 1 + ..\..\..\..\components\language\micropython\py\parse.c + + + parsenum.c + 1 + ..\..\..\..\components\language\micropython\py\parsenum.c + + + parsenumbase.c + 1 + ..\..\..\..\components\language\micropython\py\parsenumbase.c + + + persistentcode.c + 1 + ..\..\..\..\components\language\micropython\py\persistentcode.c + + + profile.c + 1 + ..\..\..\..\components\language\micropython\py\profile.c + + + pystack.c + 1 + ..\..\..\..\components\language\micropython\py\pystack.c + + + qstr.c + 1 + ..\..\..\..\components\language\micropython\py\qstr.c + + + reader.c + 1 + ..\..\..\..\components\language\micropython\py\reader.c + + + repl.c + 1 + ..\..\..\..\components\language\micropython\py\repl.c + + + ringbuf.c + 1 + ..\..\..\..\components\language\micropython\py\ringbuf.c + + + runtime.c + 1 + ..\..\..\..\components\language\micropython\py\runtime.c + + + runtime_utils.c + 1 + ..\..\..\..\components\language\micropython\py\runtime_utils.c + + + scheduler.c + 1 + ..\..\..\..\components\language\micropython\py\scheduler.c + + + scope.c + 1 + ..\..\..\..\components\language\micropython\py\scope.c + + + sequence.c + 1 + ..\..\..\..\components\language\micropython\py\sequence.c + + + showbc.c + 1 + ..\..\..\..\components\language\micropython\py\showbc.c + + + smallint.c + 1 + ..\..\..\..\components\language\micropython\py\smallint.c + + + stackctrl.c + 1 + ..\..\..\..\components\language\micropython\py\stackctrl.c + + + stream.c + 1 + ..\..\..\..\components\language\micropython\py\stream.c + + + unicode.c + 1 + ..\..\..\..\components\language\micropython\py\unicode.c + + + vm.c + 1 + ..\..\..\..\components\language\micropython\py\vm.c + + + vstr.c + 1 + ..\..\..\..\components\language\micropython\py\vstr.c + + + warning.c + 1 + ..\..\..\..\components\language\micropython\py\warning.c + + + + + micropython/shared + + + readline.c + 1 + ..\..\..\..\components\language\micropython\shared\readline\readline.c + + + pyexec.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\pyexec.c + + + sys_stdio_mphal.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\sys_stdio_mphal.c + + + interrupt_char.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\interrupt_char.c + + + stdout_helpers.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\stdout_helpers.c + + + + + micropython/extmod + + + utime_mphal.c + 1 + ..\..\..\..\components\language\micropython\extmod\utime_mphal.c + + + machine_signal.c + 1 + ..\..\..\..\components\language\micropython\extmod\machine_signal.c + + + virtpin.c + 1 + ..\..\..\..\components\language\micropython\extmod\virtpin.c + + + machine_mem.c + 1 + ..\..\..\..\components\language\micropython\extmod\machine_mem.c + + + + + micropython/port + + + help.c + 1 + ..\..\..\..\components\language\micropython\port\help.c + + + mphalport.c + 1 + ..\..\..\..\components\language\micropython\port\mphalport.c + + + mpmain.c + 1 + ..\..\..\..\components\language\micropython\port\mpmain.c + + + mpthreadport.c + 1 + ..\..\..\..\components\language\micropython\port\mpthreadport.c + + + machine_hw_spi.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_hw_spi.c + + + machine_pin.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_pin.c + + + machine_timer.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_timer.c + + + machine_uart.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_uart.c + + + modesp8266.c + 1 + ..\..\..\..\components\language\micropython\port\modules\modesp8266.c + + + modmachine.c + 1 + ..\..\..\..\components\language\micropython\port\modules\modmachine.c + + + modutime.c + 1 + ..\..\..\..\components\language\micropython\port\modules\modutime.c + + + vfs_tos.c + 1 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos.c + + + vfs_tos_file.c + 1 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos_file.c + + + mphalboard.c + 1 + .\board\mphalboard.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_pin.c b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_pin.c new file mode 100644 index 00000000..1090378b --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_pin.c @@ -0,0 +1,273 @@ +#include "tos_k.h" +#include "mp_tos_hal_pin.h" +#include "gpio.h" + +#define ST_EXTI_VECTOR_SIZE 16 + +#define ST_PORT_NUM(port) ((uint8_t)((port) >> 4) & 0x0F) +#define ST_PIN_NUM(port) ((uint8_t)((port) & 0x0F)) + +__STATIC__ hal_pin_cb_t hal_pin_irq_handler[ST_EXTI_VECTOR_SIZE]; +__STATIC__ void *hal_pin_irq_handler_arg[ST_EXTI_VECTOR_SIZE]; +__STATIC__ GPIO_TypeDef *hal_pin_irq_gpio[ST_EXTI_VECTOR_SIZE]; + +__STATIC__ const uint8_t nvic_irq_channel[ST_EXTI_VECTOR_SIZE] = { + EXTI0_IRQn, EXTI1_IRQn, EXTI2_IRQn, EXTI3_IRQn, + EXTI4_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, + EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, + EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, +}; + +__STATIC__ int mask2no(uint32_t mask) { + for (int i = 0; i < 32; i++) { + if ((1U << i) == mask) { + return i; + } + } + return -1; +} + +__API__ int tos_hal_pin_init(hal_pin_t *pin, hal_pin_port_t port, hal_pin_mode_t mode) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + GPIO_InitTypeDef gpio_init; + + if (!pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)(GPIOA_BASE + ST_PORT_NUM(port) * 0x0400UL); + gpio_pin = 1UL << ST_PIN_NUM(port); + + gpio_init.Pin = gpio_pin; + gpio_init.Speed = GPIO_SPEED_FREQ_HIGH; + switch (mode) { + case HAL_PIN_MODE_OUTPUT: + gpio_init.Mode = GPIO_MODE_OUTPUT_PP; + gpio_init.Pull = GPIO_NOPULL; + break; + case HAL_PIN_MODE_OUTPUT_OD: + gpio_init.Mode = GPIO_MODE_OUTPUT_OD; + gpio_init.Pull = GPIO_NOPULL; + break; + case HAL_PIN_MODE_INPUT: + gpio_init.Mode = GPIO_MODE_INPUT; + gpio_init.Pull = GPIO_NOPULL; + break; + case HAL_PIN_MODE_INPUT_PULLUP: + gpio_init.Mode = GPIO_MODE_INPUT; + gpio_init.Pull = GPIO_PULLUP; + break; + case HAL_PIN_MODE_INPUT_PULLDOWN: + gpio_init.Mode = GPIO_MODE_INPUT; + gpio_init.Pull = GPIO_PULLDOWN; + break; + default: + return -1; + } + HAL_GPIO_Init((GPIO_TypeDef *)gpiox, &gpio_init); + + pin->port = port; + pin->private_gpio = gpiox; + pin->private_pin = gpio_pin; + pin->mode = mode; + + return 0; +} + +__API__ int tos_hal_pin_irq(hal_pin_t *pin, hal_pin_irq_t irq) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + uint32_t gpio_pin_num; + GPIO_InitTypeDef gpio_init; + TOS_CPU_CPSR_ALLOC(); + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + gpio_pin_num = mask2no(gpio_pin); + if (gpio_pin_num >= ST_EXTI_VECTOR_SIZE) { + return -1; + } + + TOS_CPU_INT_DISABLE(); + if (hal_pin_irq_gpio[gpio_pin_num] != NULL && hal_pin_irq_gpio[gpio_pin_num] != gpiox) { + TOS_CPU_INT_ENABLE(); + return -1; + } + + if (irq == HAL_PIN_IRQ_NONE) { + hal_pin_irq_gpio[gpio_pin_num] = NULL; + hal_pin_irq_handler[gpio_pin_num] = NULL; + hal_pin_irq_handler_arg[gpio_pin_num] = NULL; + TOS_CPU_INT_ENABLE(); + HAL_NVIC_DisableIRQ(nvic_irq_channel[gpio_pin_num]); + } else { + hal_pin_irq_gpio[gpio_pin_num] = gpiox; + TOS_CPU_INT_ENABLE(); + gpio_init.Pin = gpio_pin; + gpio_init.Speed = GPIO_SPEED_FREQ_HIGH; + gpio_init.Mode = GPIO_MODE_IT_RISING_FALLING; + switch (irq) { + case HAL_PIN_IRQ_RISING: + gpio_init.Mode = GPIO_MODE_IT_RISING; + break; + case HAL_PIN_IRQ_FALLING: + gpio_init.Mode = GPIO_MODE_IT_FALLING; + break; + case HAL_PIN_IRQ_RISING_FALLING: + gpio_init.Mode = GPIO_MODE_IT_RISING_FALLING; + break; + } + switch (pin->mode) { + case HAL_PIN_MODE_INPUT_PULLUP: + gpio_init.Pull = GPIO_PULLUP; + break; + case HAL_PIN_MODE_INPUT_PULLDOWN: + gpio_init.Pull = GPIO_PULLDOWN; + break; + default: + gpio_init.Pull = GPIO_NOPULL; + break; + } + HAL_GPIO_Init(gpiox, &gpio_init); + HAL_NVIC_SetPriority(nvic_irq_channel[gpio_pin_num], 2, 0); + HAL_NVIC_EnableIRQ(nvic_irq_channel[gpio_pin_num]); + + pin->irq = irq; + } + + return 0; +} + +__API__ int tos_hal_pin_irq_callback(hal_pin_t *pin, hal_pin_cb_t callback, void *cb_arg) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + uint32_t gpio_pin_num; + TOS_CPU_CPSR_ALLOC(); + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + gpio_pin_num = mask2no(gpio_pin); + if (gpio_pin_num >= ST_EXTI_VECTOR_SIZE) { + return -1; + } + + TOS_CPU_INT_DISABLE(); + if (hal_pin_irq_gpio[gpio_pin_num] != NULL && hal_pin_irq_gpio[gpio_pin_num] != gpiox) { + TOS_CPU_INT_ENABLE(); + return -1; + } + hal_pin_irq_handler[gpio_pin_num] = gpiox; + hal_pin_irq_handler[gpio_pin_num] = callback; + hal_pin_irq_handler_arg[gpio_pin_num] = cb_arg; + TOS_CPU_INT_ENABLE(); + + return 0; +} + +__API__ int tos_hal_pin_write(hal_pin_t *pin, int state) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + + HAL_GPIO_WritePin(gpiox, gpio_pin, (state == 0) ? GPIO_PIN_RESET : GPIO_PIN_SET); + + return 0; +} + +__API__ int tos_hal_pin_read(hal_pin_t *pin) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + + return (HAL_GPIO_ReadPin(gpiox, gpio_pin) == GPIO_PIN_RESET) ? 0 : 1; +} + +__API__ int tos_hal_pin_deinit(hal_pin_t *pin) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + uint32_t gpio_pin_num; + TOS_CPU_CPSR_ALLOC(); + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + gpio_pin_num = mask2no(gpio_pin); + + TOS_CPU_INT_DISABLE(); + if (hal_pin_irq_gpio[gpio_pin_num] == gpiox) { + hal_pin_irq_gpio[gpio_pin_num] = NULL; + hal_pin_irq_handler[gpio_pin_num] = NULL; + hal_pin_irq_handler_arg[gpio_pin_num] = NULL; + } + TOS_CPU_INT_ENABLE(); + HAL_GPIO_DeInit(gpiox, gpio_pin); + + return 0; +} + +void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) +{ + uint32_t gpio_pin_num = mask2no(GPIO_Pin); + hal_pin_cb_t callback; + uint32_t cb_arg; + if (gpio_pin_num < ST_EXTI_VECTOR_SIZE) { + + callback = hal_pin_irq_handler[gpio_pin_num]; + cb_arg = hal_pin_irq_handler_arg[gpio_pin_num]; + if (callback) { + callback(cb_arg); + } + } +} + + diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_pin.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_pin.h new file mode 100644 index 00000000..6ac564d1 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_pin.h @@ -0,0 +1,45 @@ +#ifndef _TOS_HAL_PIN_H_ +#define _TOS_HAL_PIN_H_ + +typedef unsigned char hal_pin_port_t; + +typedef enum hal_pin_mode_en { + HAL_PIN_MODE_OUTPUT = 0, + HAL_PIN_MODE_OUTPUT_OD, + HAL_PIN_MODE_INPUT, + HAL_PIN_MODE_INPUT_PULLUP, + HAL_PIN_MODE_INPUT_PULLDOWN, +} hal_pin_mode_t; + +typedef enum hal_pin_irq_en { + HAL_PIN_IRQ_NONE = 0x00, + HAL_PIN_IRQ_RISING = 0x01, + HAL_PIN_IRQ_FALLING = 0x02, + HAL_PIN_IRQ_RISING_FALLING = 0x03, +} hal_pin_irq_t; + +typedef struct hal_pin_st { + hal_pin_port_t port; + void *private_gpio; + void *private_pin; + hal_pin_mode_t mode; + hal_pin_irq_t irq; +} hal_pin_t; + + +typedef void (*hal_pin_cb_t)(void *arg); + +__API__ int tos_hal_pin_init(hal_pin_t *pin, hal_pin_port_t port, hal_pin_mode_t mode); + +__API__ int tos_hal_pin_write(hal_pin_t *pin, int state); + +__API__ int tos_hal_pin_read(hal_pin_t *pin); + +__API__ int tos_hal_pin_mode(hal_pin_t *pin, hal_pin_mode_t mode); + +__API__ int tos_hal_pin_irq(hal_pin_t *pin, hal_pin_irq_t irq); + +__API__ int tos_hal_pin_irq_callback(hal_pin_t *pin, hal_pin_cb_t callback, void *cb_arg); + + +#endif diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_spi.c b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_spi.c new file mode 100644 index 00000000..b4f58be9 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_spi.c @@ -0,0 +1,80 @@ +#include "tos_k.h" +#include "mp_tos_hal_spi.h" +#include "stm32l4xx_hal.h" +#include "spi.h" + +__API__ int tos_hal_spi_init(hal_spi_t *spi, hal_spi_port_t port) +{ + if (!spi) { + return -1; + } + + if (port == HAL_SPI_PORT_1) { + spi->private_spi = &hspi1; + MX_SPI1_Init(); + } else if (port == HAL_SPI_PORT_2) { + spi->private_spi = &hspi2; + MX_SPI2_Init(); + } else if (port == HAL_SPI_PORT_3) { + spi->private_spi = &hspi3; + MX_SPI3_Init(); + } else { + return -1; + } + + return 0; +} + +__API__ int tos_hal_spi_transfer(hal_spi_t *spi, const uint8_t *send_buf, uint8_t *recv_buf, size_t size, uint32_t timeout) +{ + HAL_StatusTypeDef hal_status; + SPI_HandleTypeDef *spi_handle; + + if (!spi || (!send_buf && !recv_buf)) { + return -1; + } + + if (!spi->private_spi) { + return -1; + } + + spi_handle = (SPI_HandleTypeDef *)spi->private_spi; + + if (send_buf && recv_buf) { + hal_status = HAL_SPI_TransmitReceive(spi_handle, send_buf, recv_buf, size, timeout); + } else if (send_buf) { + hal_status = HAL_SPI_Transmit(spi_handle, send_buf, size, timeout); + } else if (recv_buf) { + hal_status = HAL_SPI_Receive(spi_handle, send_buf, size, timeout); + } + + if (hal_status != HAL_OK) { + return -1; + } + return 0; +} + +__API__ int tos_hal_spi_deinit(hal_spi_t *spi) +{ + HAL_StatusTypeDef hal_status; + SPI_HandleTypeDef *spi_handle; + + if (!spi) { + return -1; + } + + if (!spi->private_spi) { + return -1; + } + + spi_handle = (SPI_HandleTypeDef *)spi->private_spi; + + hal_status = HAL_SPI_DeInit(spi_handle); + HAL_SPI_MspDeInit(spi_handle); + + if (hal_status != HAL_OK) { + return -1; + } + + return 0; +} diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_spi.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_spi.h new file mode 100644 index 00000000..6dad4e9f --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_spi.h @@ -0,0 +1,22 @@ +#ifndef _TOS_HAL_SPI_H_ +#define _TOS_HAL_SPI_H_ + +typedef enum hal_spi_port_en { + HAL_SPI_PORT_0 = 0, + HAL_SPI_PORT_1, + HAL_SPI_PORT_2, + HAL_SPI_PORT_3, +} hal_spi_port_t; + +typedef struct hal_spi_st { + hal_spi_port_t port; + void *private_spi; +} hal_spi_t; + +__API__ int tos_hal_spi_init(hal_spi_t *spi, hal_spi_port_t port); + +__API__ int tos_hal_spi_transfer(hal_spi_t *spi, const uint8_t *send_buf, uint8_t *recv_buf, size_t size, uint32_t timeout); + +__API__ int tos_hal_spi_deinit(hal_spi_t *spi); + +#endif diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_uart.c b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_uart.c new file mode 100644 index 00000000..a86dd40d --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_uart.c @@ -0,0 +1,26 @@ +#include "tos_k.h" +#include "mp_tos_hal_uart.h" +#include "stm32l4xx_hal.h" +#include "usart.h" + +__API__ int tos_hal_uart_recv_start(hal_uart_t *uart, const uint8_t *buf, size_t size) +{ + HAL_StatusTypeDef hal_status; + UART_HandleTypeDef *uart_handle; + + if (!uart || !buf) { + return -1; + } + + if (!uart->private_uart) { + return -1; + } + + uart_handle = (UART_HandleTypeDef *)uart->private_uart; + + hal_status = HAL_UART_Receive_IT(uart_handle, (uint8_t *)buf, size); + if (hal_status != HAL_OK) { + return -1; + } + return 0; +} diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_uart.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_uart.h new file mode 100644 index 00000000..31b79dbf --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/hal/mp_tos_hal_uart.h @@ -0,0 +1,8 @@ +#ifndef _MP_TOS_HAL_UART_H_ +#define _MP_TOS_HAL_UART_H_ + +#include "tos_hal_uart.h" + +__API__ int tos_hal_uart_recv_start(hal_uart_t *uart, const uint8_t *buf, size_t size); + +#endif diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mpconfigboard.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mpconfigboard.h new file mode 100644 index 00000000..326a2eb3 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mpconfigboard.h @@ -0,0 +1,10 @@ +/* board specific config */ +#define MICROPY_HW_BOARD_NAME "BearPi" +#define MICROPY_HW_MCU_NAME "STM32F431RC" + +#define MICROPY_HW_UART_NUM 4 +#define MICROPY_HW_UART_REPL 2 +#define MICROPY_HW_SPI_NUM 4 + +/* project specific config */ +#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES) diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mpconfigboard.mk b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mpconfigboard.mk new file mode 100644 index 00000000..e69de29b diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mphalboard.c b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mphalboard.c new file mode 100644 index 00000000..58d8f0a0 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mphalboard.c @@ -0,0 +1,109 @@ + +#include "py/mpconfig.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + +#include "modmachine.h" + +#if !(MP_GEN_HDR) +#include "tos_k.h" +#include "main.h" +#endif + +/********************** Tick *************************/ + +static uint32_t systick_get_us() { + // get systick value + uint32_t counter = SysTick->VAL; + uint32_t load = SysTick->LOAD; + + // convert from decrementing to incrementing + counter = load - counter; + + return (counter * 1000) / (load + 1); +} + +mp_uint_t mp_hal_ticks_us(void) { + uint32_t ms = tos_tick2millisec(tos_systick_get()); + uint32_t us = systick_get_us(); + return ms * 1000 + us; +} + +void mp_hal_delay_us(mp_uint_t usec) { + mp_uint_t ms = usec / 1000; + mp_uint_t us = usec % 1000; + if (ms > 0) + mp_hal_delay_ms(ms); + mp_uint_t start = mp_hal_ticks_us(); + while (mp_hal_ticks_us() - start < us) { + } +} + +/********************** GPIO *************************/ + +#define ST_PIN(port_num, pin_num) ((uint8_t)(((port_num) << 4) & 0xF0) | ((pin_num) & 0x0F)) + +STATIC const mp_rom_map_elem_t machine_pins_locals_dict_table[] = { + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_INT(ST_PIN(0, 0)) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_INT(ST_PIN(0, 1)) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_INT(ST_PIN(0, 2)) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_INT(ST_PIN(0, 3)) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_INT(ST_PIN(0, 4)) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_INT(ST_PIN(0, 5)) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_INT(ST_PIN(0, 6)) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_INT(ST_PIN(0, 7)) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_INT(ST_PIN(0, 8)) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_INT(ST_PIN(0, 9)) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_INT(ST_PIN(0, 10)) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_INT(ST_PIN(0, 11)) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_INT(ST_PIN(0, 12)) }, + { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_INT(ST_PIN(0, 13)) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_INT(ST_PIN(0, 14)) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_INT(ST_PIN(0, 15)) }, + + { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_INT(ST_PIN(1, 0)) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_INT(ST_PIN(1, 1)) }, + { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_INT(ST_PIN(1, 2)) }, + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_INT(ST_PIN(1, 3)) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_INT(ST_PIN(1, 4)) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_INT(ST_PIN(1, 5)) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_INT(ST_PIN(1, 6)) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_INT(ST_PIN(1, 7)) }, + { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_INT(ST_PIN(1, 8)) }, + { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_INT(ST_PIN(1, 9)) }, + { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_INT(ST_PIN(1, 10)) }, + { MP_ROM_QSTR(MP_QSTR_B11), MP_ROM_INT(ST_PIN(1, 11)) }, + { MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_INT(ST_PIN(1, 12)) }, + { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_INT(ST_PIN(1, 13)) }, + { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_INT(ST_PIN(1, 14)) }, + { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_INT(ST_PIN(1, 15)) }, + + { MP_ROM_QSTR(MP_QSTR_C0), MP_ROM_INT(ST_PIN(2, 0)) }, + { MP_ROM_QSTR(MP_QSTR_C1), MP_ROM_INT(ST_PIN(2, 1)) }, + { MP_ROM_QSTR(MP_QSTR_C2), MP_ROM_INT(ST_PIN(2, 2)) }, + { MP_ROM_QSTR(MP_QSTR_C3), MP_ROM_INT(ST_PIN(2, 3)) }, + { MP_ROM_QSTR(MP_QSTR_C4), MP_ROM_INT(ST_PIN(2, 4)) }, + { MP_ROM_QSTR(MP_QSTR_C5), MP_ROM_INT(ST_PIN(2, 5)) }, + { MP_ROM_QSTR(MP_QSTR_C6), MP_ROM_INT(ST_PIN(2, 6)) }, + { MP_ROM_QSTR(MP_QSTR_C7), MP_ROM_INT(ST_PIN(2, 7)) }, + { MP_ROM_QSTR(MP_QSTR_C8), MP_ROM_INT(ST_PIN(2, 8)) }, + { MP_ROM_QSTR(MP_QSTR_C9), MP_ROM_INT(ST_PIN(2, 9)) }, + { MP_ROM_QSTR(MP_QSTR_C10), MP_ROM_INT(ST_PIN(2, 10)) }, + { MP_ROM_QSTR(MP_QSTR_C11), MP_ROM_INT(ST_PIN(2, 11)) }, + { MP_ROM_QSTR(MP_QSTR_C12), MP_ROM_INT(ST_PIN(2, 12)) }, + { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_INT(ST_PIN(2, 13)) }, + { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_INT(ST_PIN(2, 14)) }, + { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_INT(ST_PIN(2, 15)) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_INT(ST_PIN(3, 2)) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_INT(ST_PIN(2, 13)) }, // C13 + { MP_ROM_QSTR(MP_QSTR_KEY1), MP_ROM_INT(ST_PIN(1, 2)) }, // B2 + { MP_ROM_QSTR(MP_QSTR_KEY2), MP_ROM_INT(ST_PIN(1, 3)) }, // B3 + +}; +MP_DEFINE_CONST_DICT(machine_pins_locals_dict, machine_pins_locals_dict_table); + + diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mphalboard.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mphalboard.h new file mode 100644 index 00000000..bebb5f6d --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/board/mphalboard.h @@ -0,0 +1,11 @@ +#ifndef _MPHALBOARD_H_ +#define _MPHALBOARD_H_ + +#include "py/obj.h" + +extern mp_uint_t mp_hal_ticks_us(void); +extern void mp_hal_delay_us(mp_uint_t usec); + +extern const mp_obj_dict_t machine_pins_locals_dict; + +#endif /* _MPHALBOARD_H_ */ diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/moduledefs.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/moduledefs.h new file mode 100644 index 00000000..b8a66465 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/moduledefs.h @@ -0,0 +1,65 @@ +// Automatically generated by makemoduledefs.py. + +extern const struct _mp_obj_module_t mp_module___main__; +#undef MODULE_DEF_MP_QSTR___MAIN__ +#define MODULE_DEF_MP_QSTR___MAIN__ { MP_ROM_QSTR(MP_QSTR___main__), MP_ROM_PTR(&mp_module___main__) }, + +extern const struct _mp_obj_module_t mp_module_thread; +#undef MODULE_DEF_MP_QSTR__THREAD +#define MODULE_DEF_MP_QSTR__THREAD { MP_ROM_QSTR(MP_QSTR__thread), MP_ROM_PTR(&mp_module_thread) }, + +extern const struct _mp_obj_module_t mp_module_builtins; +#undef MODULE_DEF_MP_QSTR_BUILTINS +#define MODULE_DEF_MP_QSTR_BUILTINS { MP_ROM_QSTR(MP_QSTR_builtins), MP_ROM_PTR(&mp_module_builtins) }, + +extern const struct _mp_obj_module_t mp_module_gc; +#undef MODULE_DEF_MP_QSTR_GC +#define MODULE_DEF_MP_QSTR_GC { MP_ROM_QSTR(MP_QSTR_gc), MP_ROM_PTR(&mp_module_gc) }, + +extern const struct _mp_obj_module_t mp_module_math; +#undef MODULE_DEF_MP_QSTR_MATH +#define MODULE_DEF_MP_QSTR_MATH { MP_ROM_QSTR(MP_QSTR_math), MP_ROM_PTR(&mp_module_math) }, + +extern const struct _mp_obj_module_t mp_module_micropython; +#undef MODULE_DEF_MP_QSTR_MICROPYTHON +#define MODULE_DEF_MP_QSTR_MICROPYTHON { MP_ROM_QSTR(MP_QSTR_micropython), MP_ROM_PTR(&mp_module_micropython) }, + +extern const struct _mp_obj_module_t mp_module_uarray; +#undef MODULE_DEF_MP_QSTR_UARRAY +#define MODULE_DEF_MP_QSTR_UARRAY { MP_ROM_QSTR(MP_QSTR_uarray), MP_ROM_PTR(&mp_module_uarray) }, + +extern const struct _mp_obj_module_t mp_module_collections; +#undef MODULE_DEF_MP_QSTR_UCOLLECTIONS +#define MODULE_DEF_MP_QSTR_UCOLLECTIONS { MP_ROM_QSTR(MP_QSTR_ucollections), MP_ROM_PTR(&mp_module_collections) }, + +extern const struct _mp_obj_module_t mp_module_machine; +#undef MODULE_DEF_MP_QSTR_UMACHINE +#define MODULE_DEF_MP_QSTR_UMACHINE { MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, + +extern const struct _mp_obj_module_t mp_module_ustruct; +#undef MODULE_DEF_MP_QSTR_USTRUCT +#define MODULE_DEF_MP_QSTR_USTRUCT { MP_ROM_QSTR(MP_QSTR_ustruct), MP_ROM_PTR(&mp_module_ustruct) }, + +extern const struct _mp_obj_module_t mp_module_sys; +#undef MODULE_DEF_MP_QSTR_USYS +#define MODULE_DEF_MP_QSTR_USYS { MP_ROM_QSTR(MP_QSTR_usys), MP_ROM_PTR(&mp_module_sys) }, + +extern const struct _mp_obj_module_t mp_module_utime; +#undef MODULE_DEF_MP_QSTR_UTIME +#define MODULE_DEF_MP_QSTR_UTIME { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, + + +#define MICROPY_REGISTERED_MODULES \ + MODULE_DEF_MP_QSTR_BUILTINS \ + MODULE_DEF_MP_QSTR_GC \ + MODULE_DEF_MP_QSTR_MATH \ + MODULE_DEF_MP_QSTR_MICROPYTHON \ + MODULE_DEF_MP_QSTR_UARRAY \ + MODULE_DEF_MP_QSTR_UCOLLECTIONS \ + MODULE_DEF_MP_QSTR_UMACHINE \ + MODULE_DEF_MP_QSTR_USTRUCT \ + MODULE_DEF_MP_QSTR_USYS \ + MODULE_DEF_MP_QSTR_UTIME \ + MODULE_DEF_MP_QSTR__THREAD \ + MODULE_DEF_MP_QSTR___MAIN__ \ +// MICROPY_REGISTERED_MODULES diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/mpversion.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/mpversion.h new file mode 100644 index 00000000..22f31f30 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/mpversion.h @@ -0,0 +1,4 @@ +// This file was generated by py/makeversionhdr.py +#define MICROPY_GIT_TAG "v2.5.0-74-g467a6d7d-dirty" +#define MICROPY_GIT_HASH "467a6d7d-dirty" +#define MICROPY_BUILD_DATE "2022-09-28" diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/qstrdefs.generated.h b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/qstrdefs.generated.h new file mode 100644 index 00000000..18249bac --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/genhdr/qstrdefs.generated.h @@ -0,0 +1,436 @@ +// This file was automatically generated by makeqstrdata.py + +QDEF(MP_QSTRnull, 0, 0, "") +QDEF(MP_QSTR_, 5381, 0, "") +QDEF(MP_QSTR___dir__, 36730, 7, "__dir__") +QDEF(MP_QSTR__0x0a_, 46511, 1, "\x0a") +QDEF(MP_QSTR__space_, 46469, 1, " ") +QDEF(MP_QSTR__star_, 46479, 1, "*") +QDEF(MP_QSTR__slash_, 46474, 1, "/") +QDEF(MP_QSTR__lt_module_gt_, 38077, 8, "") +QDEF(MP_QSTR__, 46586, 1, "_") +QDEF(MP_QSTR___call__, 63911, 8, "__call__") +QDEF(MP_QSTR___class__, 50475, 9, "__class__") +QDEF(MP_QSTR___delitem__, 13821, 11, "__delitem__") +QDEF(MP_QSTR___enter__, 47725, 9, "__enter__") +QDEF(MP_QSTR___exit__, 63557, 8, "__exit__") +QDEF(MP_QSTR___getattr__, 63552, 11, "__getattr__") +QDEF(MP_QSTR___getitem__, 14630, 11, "__getitem__") +QDEF(MP_QSTR___hash__, 51447, 8, "__hash__") +QDEF(MP_QSTR___init__, 42335, 8, "__init__") +QDEF(MP_QSTR___int__, 6934, 7, "__int__") +QDEF(MP_QSTR___iter__, 13007, 8, "__iter__") +QDEF(MP_QSTR___len__, 45282, 7, "__len__") +QDEF(MP_QSTR___main__, 5006, 8, "__main__") +QDEF(MP_QSTR___module__, 12543, 10, "__module__") +QDEF(MP_QSTR___name__, 14562, 8, "__name__") +QDEF(MP_QSTR___new__, 5497, 7, "__new__") +QDEF(MP_QSTR___next__, 29442, 8, "__next__") +QDEF(MP_QSTR___qualname__, 107, 12, "__qualname__") +QDEF(MP_QSTR___repr__, 2832, 8, "__repr__") +QDEF(MP_QSTR___setitem__, 15922, 11, "__setitem__") +QDEF(MP_QSTR___str__, 52688, 7, "__str__") +QDEF(MP_QSTR_ArithmeticError, 35885, 15, "ArithmeticError") +QDEF(MP_QSTR_AssertionError, 23191, 14, "AssertionError") +QDEF(MP_QSTR_AttributeError, 56865, 14, "AttributeError") +QDEF(MP_QSTR_BaseException, 37383, 13, "BaseException") +QDEF(MP_QSTR_EOFError, 49041, 8, "EOFError") +QDEF(MP_QSTR_Ellipsis, 57584, 8, "Ellipsis") +QDEF(MP_QSTR_Exception, 10738, 9, "Exception") +QDEF(MP_QSTR_GeneratorExit, 25110, 13, "GeneratorExit") +QDEF(MP_QSTR_ImportError, 39968, 11, "ImportError") +QDEF(MP_QSTR_IndentationError, 8284, 16, "IndentationError") +QDEF(MP_QSTR_IndexError, 44419, 10, "IndexError") +QDEF(MP_QSTR_KeyError, 234, 8, "KeyError") +QDEF(MP_QSTR_KeyboardInterrupt, 58031, 17, "KeyboardInterrupt") +QDEF(MP_QSTR_LookupError, 27135, 11, "LookupError") +QDEF(MP_QSTR_MemoryError, 33756, 11, "MemoryError") +QDEF(MP_QSTR_NameError, 11706, 9, "NameError") +QDEF(MP_QSTR_NoneType, 26647, 8, "NoneType") +QDEF(MP_QSTR_NotImplementedError, 39110, 19, "NotImplementedError") +QDEF(MP_QSTR_OSError, 26017, 7, "OSError") +QDEF(MP_QSTR_OverflowError, 57729, 13, "OverflowError") +QDEF(MP_QSTR_RuntimeError, 61793, 12, "RuntimeError") +QDEF(MP_QSTR_StopIteration, 7402, 13, "StopIteration") +QDEF(MP_QSTR_SyntaxError, 36756, 11, "SyntaxError") +QDEF(MP_QSTR_SystemExit, 65312, 10, "SystemExit") +QDEF(MP_QSTR_TypeError, 38437, 9, "TypeError") +QDEF(MP_QSTR_ValueError, 34710, 10, "ValueError") +QDEF(MP_QSTR_ZeroDivisionError, 10166, 17, "ZeroDivisionError") +QDEF(MP_QSTR_abs, 12949, 3, "abs") +QDEF(MP_QSTR_all, 13124, 3, "all") +QDEF(MP_QSTR_any, 13075, 3, "any") +QDEF(MP_QSTR_append, 38763, 6, "append") +QDEF(MP_QSTR_args, 50882, 4, "args") +QDEF(MP_QSTR_bool, 15595, 4, "bool") +QDEF(MP_QSTR_builtins, 12791, 8, "builtins") +QDEF(MP_QSTR_bytearray, 41846, 9, "bytearray") +QDEF(MP_QSTR_bytecode, 32034, 8, "bytecode") +QDEF(MP_QSTR_bytes, 45660, 5, "bytes") +QDEF(MP_QSTR_callable, 28685, 8, "callable") +QDEF(MP_QSTR_chr, 19676, 3, "chr") +QDEF(MP_QSTR_classmethod, 36020, 11, "classmethod") +QDEF(MP_QSTR_clear, 41084, 5, "clear") +QDEF(MP_QSTR_close, 26419, 5, "close") +QDEF(MP_QSTR_const, 65472, 5, "const") +QDEF(MP_QSTR_copy, 56288, 4, "copy") +QDEF(MP_QSTR_count, 19878, 5, "count") +QDEF(MP_QSTR_dict, 64575, 4, "dict") +QDEF(MP_QSTR_dir, 7930, 3, "dir") +QDEF(MP_QSTR_divmod, 1208, 6, "divmod") +QDEF(MP_QSTR_end, 8970, 3, "end") +QDEF(MP_QSTR_endswith, 41755, 8, "endswith") +QDEF(MP_QSTR_eval, 42651, 4, "eval") +QDEF(MP_QSTR_exec, 49182, 4, "exec") +QDEF(MP_QSTR_extend, 59491, 6, "extend") +QDEF(MP_QSTR_find, 13312, 4, "find") +QDEF(MP_QSTR_format, 13094, 6, "format") +QDEF(MP_QSTR_from_bytes, 29749, 10, "from_bytes") +QDEF(MP_QSTR_get, 15155, 3, "get") +QDEF(MP_QSTR_getattr, 6080, 7, "getattr") +QDEF(MP_QSTR_globals, 18845, 7, "globals") +QDEF(MP_QSTR_hasattr, 45196, 7, "hasattr") +QDEF(MP_QSTR_hash, 28855, 4, "hash") +QDEF(MP_QSTR_id, 28456, 2, "id") +QDEF(MP_QSTR_index, 10363, 5, "index") +QDEF(MP_QSTR_insert, 21522, 6, "insert") +QDEF(MP_QSTR_int, 21270, 3, "int") +QDEF(MP_QSTR_isalpha, 14315, 7, "isalpha") +QDEF(MP_QSTR_isdigit, 39592, 7, "isdigit") +QDEF(MP_QSTR_isinstance, 48822, 10, "isinstance") +QDEF(MP_QSTR_islower, 33020, 7, "islower") +QDEF(MP_QSTR_isspace, 63579, 7, "isspace") +QDEF(MP_QSTR_issubclass, 32693, 10, "issubclass") +QDEF(MP_QSTR_isupper, 42973, 7, "isupper") +QDEF(MP_QSTR_items, 21475, 5, "items") +QDEF(MP_QSTR_iter, 8591, 4, "iter") +QDEF(MP_QSTR_join, 23719, 4, "join") +QDEF(MP_QSTR_key, 27954, 3, "key") +QDEF(MP_QSTR_keys, 4865, 4, "keys") +QDEF(MP_QSTR_len, 16482, 3, "len") +QDEF(MP_QSTR_list, 7463, 4, "list") +QDEF(MP_QSTR_little, 27273, 6, "little") +QDEF(MP_QSTR_locals, 41275, 6, "locals") +QDEF(MP_QSTR_lower, 52166, 5, "lower") +QDEF(MP_QSTR_lstrip, 47589, 6, "lstrip") +QDEF(MP_QSTR_main, 47054, 4, "main") +QDEF(MP_QSTR_map, 17337, 3, "map") +QDEF(MP_QSTR_micropython, 31755, 11, "micropython") +QDEF(MP_QSTR_next, 34882, 4, "next") +QDEF(MP_QSTR_object, 36240, 6, "object") +QDEF(MP_QSTR_open, 15057, 4, "open") +QDEF(MP_QSTR_ord, 24092, 3, "ord") +QDEF(MP_QSTR_pop, 29482, 3, "pop") +QDEF(MP_QSTR_popitem, 11455, 7, "popitem") +QDEF(MP_QSTR_pow, 29485, 3, "pow") +QDEF(MP_QSTR_print, 50772, 5, "print") +QDEF(MP_QSTR_range, 24090, 5, "range") +QDEF(MP_QSTR_read, 63927, 4, "read") +QDEF(MP_QSTR_readinto, 48971, 8, "readinto") +QDEF(MP_QSTR_readline, 6649, 8, "readline") +QDEF(MP_QSTR_remove, 35427, 6, "remove") +QDEF(MP_QSTR_replace, 9545, 7, "replace") +QDEF(MP_QSTR_repr, 63440, 4, "repr") +QDEF(MP_QSTR_reverse, 10789, 7, "reverse") +QDEF(MP_QSTR_rfind, 40146, 5, "rfind") +QDEF(MP_QSTR_rindex, 11241, 6, "rindex") +QDEF(MP_QSTR_round, 9703, 5, "round") +QDEF(MP_QSTR_rsplit, 165, 6, "rsplit") +QDEF(MP_QSTR_rstrip, 38203, 6, "rstrip") +QDEF(MP_QSTR_self, 30585, 4, "self") +QDEF(MP_QSTR_send, 30393, 4, "send") +QDEF(MP_QSTR_sep, 36643, 3, "sep") +QDEF(MP_QSTR_set, 36647, 3, "set") +QDEF(MP_QSTR_setattr, 43220, 7, "setattr") +QDEF(MP_QSTR_setdefault, 41836, 10, "setdefault") +QDEF(MP_QSTR_sort, 40383, 4, "sort") +QDEF(MP_QSTR_sorted, 5470, 6, "sorted") +QDEF(MP_QSTR_split, 13239, 5, "split") +QDEF(MP_QSTR_start, 61317, 5, "start") +QDEF(MP_QSTR_startswith, 59508, 10, "startswith") +QDEF(MP_QSTR_staticmethod, 44898, 12, "staticmethod") +QDEF(MP_QSTR_step, 13911, 4, "step") +QDEF(MP_QSTR_stop, 13981, 4, "stop") +QDEF(MP_QSTR_str, 36176, 3, "str") +QDEF(MP_QSTR_strip, 7721, 5, "strip") +QDEF(MP_QSTR_sum, 36142, 3, "sum") +QDEF(MP_QSTR_super, 45764, 5, "super") +QDEF(MP_QSTR_throw, 17587, 5, "throw") +QDEF(MP_QSTR_to_bytes, 16088, 8, "to_bytes") +QDEF(MP_QSTR_tuple, 16893, 5, "tuple") +QDEF(MP_QSTR_type, 32669, 4, "type") +QDEF(MP_QSTR_update, 30388, 6, "update") +QDEF(MP_QSTR_upper, 37927, 5, "upper") +QDEF(MP_QSTR_utf_hyphen_8, 33463, 5, "utf-8") +QDEF(MP_QSTR_value, 13390, 5, "value") +QDEF(MP_QSTR_values, 48765, 6, "values") +QDEF(MP_QSTR_write, 43160, 5, "write") +QDEF(MP_QSTR_zip, 44262, 3, "zip") +QDEF(MP_QSTR___add__, 33476, 7, "__add__") +QDEF(MP_QSTR___aenter__, 33868, 10, "__aenter__") +QDEF(MP_QSTR___aexit__, 53188, 9, "__aexit__") +QDEF(MP_QSTR___aiter__, 11086, 9, "__aiter__") +QDEF(MP_QSTR___anext__, 46211, 9, "__anext__") +QDEF(MP_QSTR___bases__, 12291, 9, "__bases__") +QDEF(MP_QSTR___bool__, 25899, 8, "__bool__") +QDEF(MP_QSTR___build_class__, 34882, 15, "__build_class__") +QDEF(MP_QSTR___contains__, 24518, 12, "__contains__") +QDEF(MP_QSTR___del__, 14184, 7, "__del__") +QDEF(MP_QSTR___dict__, 21631, 8, "__dict__") +QDEF(MP_QSTR___eq__, 15985, 6, "__eq__") +QDEF(MP_QSTR___file__, 21507, 8, "__file__") +QDEF(MP_QSTR___ge__, 18087, 6, "__ge__") +QDEF(MP_QSTR___gt__, 33462, 6, "__gt__") +QDEF(MP_QSTR___iadd__, 19053, 8, "__iadd__") +QDEF(MP_QSTR___iand__, 8615, 8, "__iand__") +QDEF(MP_QSTR___ifloordiv__, 3919, 13, "__ifloordiv__") +QDEF(MP_QSTR___ilshift__, 41600, 11, "__ilshift__") +QDEF(MP_QSTR___imatmul__, 28352, 11, "__imatmul__") +QDEF(MP_QSTR___imod__, 34378, 8, "__imod__") +QDEF(MP_QSTR___import__, 15928, 10, "__import__") +QDEF(MP_QSTR___imul__, 52760, 8, "__imul__") +QDEF(MP_QSTR___ior__, 36849, 7, "__ior__") +QDEF(MP_QSTR___ipow__, 54660, 8, "__ipow__") +QDEF(MP_QSTR___irshift__, 63710, 11, "__irshift__") +QDEF(MP_QSTR___isub__, 30728, 8, "__isub__") +QDEF(MP_QSTR___itruediv__, 545, 12, "__itruediv__") +QDEF(MP_QSTR___ixor__, 47369, 8, "__ixor__") +QDEF(MP_QSTR___le__, 5068, 6, "__le__") +QDEF(MP_QSTR___lt__, 26717, 6, "__lt__") +QDEF(MP_QSTR___ne__, 2830, 6, "__ne__") +QDEF(MP_QSTR___path__, 9160, 8, "__path__") +QDEF(MP_QSTR___repl_print__, 47872, 14, "__repl_print__") +QDEF(MP_QSTR___reversed__, 65377, 12, "__reversed__") +QDEF(MP_QSTR___sub__, 2337, 7, "__sub__") +QDEF(MP_QSTR___traceback__, 53071, 13, "__traceback__") +QDEF(MP_QSTR__percent__hash_o, 6764, 3, "%#o") +QDEF(MP_QSTR__percent__hash_x, 6779, 3, "%#x") +QDEF(MP_QSTR__brace_open__colon__hash_b_brace_close_, 14168, 5, "{:#b}") +QDEF(MP_QSTR_maximum_space_recursion_space_depth_space_exceeded, 7795, 32, "maximum recursion depth exceeded") +QDEF(MP_QSTR__lt_lambda_gt_, 35968, 8, "") +QDEF(MP_QSTR__lt_listcomp_gt_, 5588, 10, "") +QDEF(MP_QSTR__lt_dictcomp_gt_, 36300, 10, "") +QDEF(MP_QSTR__lt_setcomp_gt_, 20820, 9, "") +QDEF(MP_QSTR__lt_genexpr_gt_, 27188, 9, "") +QDEF(MP_QSTR__lt_string_gt_, 21330, 8, "") +QDEF(MP_QSTR__lt_stdin_gt_, 25571, 7, "") +QDEF(MP_QSTR_A0, 29268, 2, "A0") +QDEF(MP_QSTR_A1, 29269, 2, "A1") +QDEF(MP_QSTR_A10, 48325, 3, "A10") +QDEF(MP_QSTR_A11, 48324, 3, "A11") +QDEF(MP_QSTR_A12, 48327, 3, "A12") +QDEF(MP_QSTR_A13, 48326, 3, "A13") +QDEF(MP_QSTR_A14, 48321, 3, "A14") +QDEF(MP_QSTR_A15, 48320, 3, "A15") +QDEF(MP_QSTR_A2, 29270, 2, "A2") +QDEF(MP_QSTR_A3, 29271, 2, "A3") +QDEF(MP_QSTR_A4, 29264, 2, "A4") +QDEF(MP_QSTR_A5, 29265, 2, "A5") +QDEF(MP_QSTR_A6, 29266, 2, "A6") +QDEF(MP_QSTR_A7, 29267, 2, "A7") +QDEF(MP_QSTR_A8, 29276, 2, "A8") +QDEF(MP_QSTR_A9, 29277, 2, "A9") +QDEF(MP_QSTR_B0, 29431, 2, "B0") +QDEF(MP_QSTR_B1, 29430, 2, "B1") +QDEF(MP_QSTR_B10, 53638, 3, "B10") +QDEF(MP_QSTR_B11, 53639, 3, "B11") +QDEF(MP_QSTR_B12, 53636, 3, "B12") +QDEF(MP_QSTR_B13, 53637, 3, "B13") +QDEF(MP_QSTR_B14, 53634, 3, "B14") +QDEF(MP_QSTR_B15, 53635, 3, "B15") +QDEF(MP_QSTR_B2, 29429, 2, "B2") +QDEF(MP_QSTR_B3, 29428, 2, "B3") +QDEF(MP_QSTR_B4, 29427, 2, "B4") +QDEF(MP_QSTR_B5, 29426, 2, "B5") +QDEF(MP_QSTR_B6, 29425, 2, "B6") +QDEF(MP_QSTR_B7, 29424, 2, "B7") +QDEF(MP_QSTR_B8, 29439, 2, "B8") +QDEF(MP_QSTR_B9, 29438, 2, "B9") +QDEF(MP_QSTR_C0, 29334, 2, "C0") +QDEF(MP_QSTR_C1, 29335, 2, "C1") +QDEF(MP_QSTR_C10, 50503, 3, "C10") +QDEF(MP_QSTR_C11, 50502, 3, "C11") +QDEF(MP_QSTR_C12, 50501, 3, "C12") +QDEF(MP_QSTR_C13, 50500, 3, "C13") +QDEF(MP_QSTR_C14, 50499, 3, "C14") +QDEF(MP_QSTR_C15, 50498, 3, "C15") +QDEF(MP_QSTR_C2, 29332, 2, "C2") +QDEF(MP_QSTR_C3, 29333, 2, "C3") +QDEF(MP_QSTR_C4, 29330, 2, "C4") +QDEF(MP_QSTR_C5, 29331, 2, "C5") +QDEF(MP_QSTR_C6, 29328, 2, "C6") +QDEF(MP_QSTR_C7, 29329, 2, "C7") +QDEF(MP_QSTR_C8, 29342, 2, "C8") +QDEF(MP_QSTR_C9, 29343, 2, "C9") +QDEF(MP_QSTR_D2, 29235, 2, "D2") +QDEF(MP_QSTR_FileIO, 5573, 6, "FileIO") +QDEF(MP_QSTR_IN, 29474, 2, "IN") +QDEF(MP_QSTR_IN_PULLDOWN, 47946, 11, "IN_PULLDOWN") +QDEF(MP_QSTR_IN_PULLUP, 55837, 9, "IN_PULLUP") +QDEF(MP_QSTR_IRQ_FALLING, 49207, 11, "IRQ_FALLING") +QDEF(MP_QSTR_IRQ_RISING, 60792, 10, "IRQ_RISING") +QDEF(MP_QSTR_KEY1, 4963, 4, "KEY1") +QDEF(MP_QSTR_KEY2, 4960, 4, "KEY2") +QDEF(MP_QSTR_LED, 56456, 3, "LED") +QDEF(MP_QSTR_LockType, 8246, 8, "LockType") +QDEF(MP_QSTR_ONE_SHOT, 65374, 8, "ONE_SHOT") +QDEF(MP_QSTR_OPEN_DRAIN, 18526, 10, "OPEN_DRAIN") +QDEF(MP_QSTR_OUT, 58123, 3, "OUT") +QDEF(MP_QSTR_PERIODIC, 13578, 8, "PERIODIC") +QDEF(MP_QSTR_Pin, 5138, 3, "Pin") +QDEF(MP_QSTR_PinBase, 17223, 7, "PinBase") +QDEF(MP_QSTR_Signal, 58523, 6, "Signal") +QDEF(MP_QSTR_StopAsyncIteration, 61676, 18, "StopAsyncIteration") +QDEF(MP_QSTR_Timer, 8098, 5, "Timer") +QDEF(MP_QSTR_UART, 6583, 4, "UART") +QDEF(MP_QSTR__machine, 19391, 8, "_machine") +QDEF(MP_QSTR__thread, 724, 7, "_thread") +QDEF(MP_QSTR_acos, 40987, 4, "acos") +QDEF(MP_QSTR_acquire, 54045, 7, "acquire") +QDEF(MP_QSTR_add, 12868, 3, "add") +QDEF(MP_QSTR_alloc_emergency_exception_buf, 10872, 29, "alloc_emergency_exception_buf") +QDEF(MP_QSTR_allocate_lock, 60908, 13, "allocate_lock") +QDEF(MP_QSTR_argv, 50887, 4, "argv") +QDEF(MP_QSTR_array, 29308, 5, "array") +QDEF(MP_QSTR_asin, 58704, 4, "asin") +QDEF(MP_QSTR_atan, 48671, 4, "atan") +QDEF(MP_QSTR_atan2, 33229, 5, "atan2") +QDEF(MP_QSTR_bin, 18656, 3, "bin") +QDEF(MP_QSTR_bound_method, 41623, 12, "bound_method") +QDEF(MP_QSTR_buffer, 41189, 6, "buffer") +QDEF(MP_QSTR_byteorder, 39265, 9, "byteorder") +QDEF(MP_QSTR_calcsize, 14413, 8, "calcsize") +QDEF(MP_QSTR_callback, 61516, 8, "callback") +QDEF(MP_QSTR_ceil, 45062, 4, "ceil") +QDEF(MP_QSTR_closure, 51828, 7, "closure") +QDEF(MP_QSTR_collect, 26011, 7, "collect") +QDEF(MP_QSTR_complex, 40389, 7, "complex") +QDEF(MP_QSTR_copysign, 5171, 8, "copysign") +QDEF(MP_QSTR_cos, 19578, 3, "cos") +QDEF(MP_QSTR_decode, 22953, 6, "decode") +QDEF(MP_QSTR_default, 32206, 7, "default") +QDEF(MP_QSTR_degrees, 16642, 7, "degrees") +QDEF(MP_QSTR_deinit, 36254, 6, "deinit") +QDEF(MP_QSTR_delattr, 51419, 7, "delattr") +QDEF(MP_QSTR_deleter, 56174, 7, "deleter") +QDEF(MP_QSTR_dict_view, 43309, 9, "dict_view") +QDEF(MP_QSTR_difference, 9330, 10, "difference") +QDEF(MP_QSTR_difference_update, 64156, 17, "difference_update") +QDEF(MP_QSTR_disable, 30353, 7, "disable") +QDEF(MP_QSTR_discard, 28943, 7, "discard") +QDEF(MP_QSTR_doc, 7981, 3, "doc") +QDEF(MP_QSTR_e, 46528, 1, "e") +QDEF(MP_QSTR_enable, 56836, 6, "enable") +QDEF(MP_QSTR_encode, 51779, 6, "encode") +QDEF(MP_QSTR_enumerate, 47729, 9, "enumerate") +QDEF(MP_QSTR_errno, 4545, 5, "errno") +QDEF(MP_QSTR_exit, 48773, 4, "exit") +QDEF(MP_QSTR_exp, 9416, 3, "exp") +QDEF(MP_QSTR_fabs, 4755, 4, "fabs") +QDEF(MP_QSTR_filter, 48677, 6, "filter") +QDEF(MP_QSTR_float, 17461, 5, "float") +QDEF(MP_QSTR_floor, 18045, 5, "floor") +QDEF(MP_QSTR_fmod, 17637, 4, "fmod") +QDEF(MP_QSTR_freq, 15077, 4, "freq") +QDEF(MP_QSTR_frexp, 38940, 5, "frexp") +QDEF(MP_QSTR_fromkeys, 48439, 8, "fromkeys") +QDEF(MP_QSTR_function, 551, 8, "function") +QDEF(MP_QSTR_gc, 28257, 2, "gc") +QDEF(MP_QSTR_generator, 50070, 9, "generator") +QDEF(MP_QSTR_get_ident, 45566, 9, "get_ident") +QDEF(MP_QSTR_getter, 45712, 6, "getter") +QDEF(MP_QSTR_handler, 24029, 7, "handler") +QDEF(MP_QSTR_heap_lock, 36013, 9, "heap_lock") +QDEF(MP_QSTR_heap_unlock, 11606, 11, "heap_unlock") +QDEF(MP_QSTR_help, 23700, 4, "help") +QDEF(MP_QSTR_hex, 20592, 3, "hex") +QDEF(MP_QSTR_imag, 46919, 4, "imag") +QDEF(MP_QSTR_implementation, 11543, 14, "implementation") +QDEF(MP_QSTR_init, 46111, 4, "init") +QDEF(MP_QSTR_intersection, 10792, 12, "intersection") +QDEF(MP_QSTR_intersection_update, 56582, 19, "intersection_update") +QDEF(MP_QSTR_invert, 183, 6, "invert") +QDEF(MP_QSTR_irq, 22159, 3, "irq") +QDEF(MP_QSTR_isdisjoint, 26871, 10, "isdisjoint") +QDEF(MP_QSTR_isenabled, 58778, 9, "isenabled") +QDEF(MP_QSTR_isfinite, 43942, 8, "isfinite") +QDEF(MP_QSTR_isinf, 4414, 5, "isinf") +QDEF(MP_QSTR_isnan, 926, 5, "isnan") +QDEF(MP_QSTR_issubset, 49593, 8, "issubset") +QDEF(MP_QSTR_issuperset, 60668, 10, "issuperset") +QDEF(MP_QSTR_iterable, 37413, 8, "iterable") +QDEF(MP_QSTR_iterator, 48711, 8, "iterator") +QDEF(MP_QSTR_kbd_intr, 5110, 8, "kbd_intr") +QDEF(MP_QSTR_ldexp, 28480, 5, "ldexp") +QDEF(MP_QSTR_lock, 9134, 4, "lock") +QDEF(MP_QSTR_locked, 47631, 6, "locked") +QDEF(MP_QSTR_log, 16161, 3, "log") +QDEF(MP_QSTR_math, 47925, 4, "math") +QDEF(MP_QSTR_max, 17329, 3, "max") +QDEF(MP_QSTR_mem, 17440, 3, "mem") +QDEF(MP_QSTR_mem16, 51719, 5, "mem16") +QDEF(MP_QSTR_mem32, 51777, 5, "mem32") +QDEF(MP_QSTR_mem8, 51224, 4, "mem8") +QDEF(MP_QSTR_mem_alloc, 11090, 9, "mem_alloc") +QDEF(MP_QSTR_mem_free, 25291, 8, "mem_free") +QDEF(MP_QSTR_min, 17071, 3, "min") +QDEF(MP_QSTR_mode, 49190, 4, "mode") +QDEF(MP_QSTR_modf, 49189, 4, "modf") +QDEF(MP_QSTR_module, 39359, 6, "module") +QDEF(MP_QSTR_modules, 53740, 7, "modules") +QDEF(MP_QSTR_name, 30114, 4, "name") +QDEF(MP_QSTR_namedtuple, 5662, 10, "namedtuple") +QDEF(MP_QSTR_oct, 23805, 3, "oct") +QDEF(MP_QSTR_off, 23690, 3, "off") +QDEF(MP_QSTR_on, 28516, 2, "on") +QDEF(MP_QSTR_opt_level, 26503, 9, "opt_level") +QDEF(MP_QSTR_pack, 53692, 4, "pack") +QDEF(MP_QSTR_pack_into, 43295, 9, "pack_into") +QDEF(MP_QSTR_path, 52872, 4, "path") +QDEF(MP_QSTR_pend_throw, 29939, 10, "pend_throw") +QDEF(MP_QSTR_period, 41120, 6, "period") +QDEF(MP_QSTR_pi, 28700, 2, "pi") +QDEF(MP_QSTR_platform, 6458, 8, "platform") +QDEF(MP_QSTR_print_exception, 8732, 15, "print_exception") +QDEF(MP_QSTR_property, 10690, 8, "property") +QDEF(MP_QSTR_radians, 16263, 7, "radians") +QDEF(MP_QSTR_readlines, 22890, 9, "readlines") +QDEF(MP_QSTR_real, 63935, 4, "real") +QDEF(MP_QSTR_release, 36844, 7, "release") +QDEF(MP_QSTR_reversed, 28321, 8, "reversed") +QDEF(MP_QSTR_rxbuf, 26494, 5, "rxbuf") +QDEF(MP_QSTR_schedule, 44256, 8, "schedule") +QDEF(MP_QSTR_setter, 22788, 6, "setter") +QDEF(MP_QSTR_sin, 37041, 3, "sin") +QDEF(MP_QSTR_sleep, 10218, 5, "sleep") +QDEF(MP_QSTR_sleep_ms, 25355, 8, "sleep_ms") +QDEF(MP_QSTR_slice, 62645, 5, "slice") +QDEF(MP_QSTR_soft_reset, 26081, 10, "soft_reset") +QDEF(MP_QSTR_sqrt, 17441, 4, "sqrt") +QDEF(MP_QSTR_stack_size, 15153, 10, "stack_size") +QDEF(MP_QSTR_start_new_thread, 9687, 16, "start_new_thread") +QDEF(MP_QSTR_symmetric_difference, 26574, 20, "symmetric_difference") +QDEF(MP_QSTR_symmetric_difference_update, 63584, 27, "symmetric_difference_update") +QDEF(MP_QSTR_sys, 36540, 3, "sys") +QDEF(MP_QSTR_tan, 25086, 3, "tan") +QDEF(MP_QSTR_threshold, 12274, 9, "threshold") +QDEF(MP_QSTR_tick_hz, 56189, 7, "tick_hz") +QDEF(MP_QSTR_ticks_add, 44701, 9, "ticks_add") +QDEF(MP_QSTR_ticks_cpu, 42266, 9, "ticks_cpu") +QDEF(MP_QSTR_ticks_diff, 57521, 10, "ticks_diff") +QDEF(MP_QSTR_ticks_ms, 12866, 8, "ticks_ms") +QDEF(MP_QSTR_timeout, 21566, 7, "timeout") +QDEF(MP_QSTR_timeout_char, 19065, 12, "timeout_char") +QDEF(MP_QSTR_trigger, 35997, 7, "trigger") +QDEF(MP_QSTR_trunc, 39259, 5, "trunc") +QDEF(MP_QSTR_uarray, 34441, 6, "uarray") +QDEF(MP_QSTR_ucollections, 39445, 12, "ucollections") +QDEF(MP_QSTR_umachine, 32661, 8, "umachine") +QDEF(MP_QSTR_union, 31990, 5, "union") +QDEF(MP_QSTR_unpack, 15367, 6, "unpack") +QDEF(MP_QSTR_unpack_from, 27918, 11, "unpack_from") +QDEF(MP_QSTR_ustruct, 2119, 7, "ustruct") +QDEF(MP_QSTR_usys, 62409, 4, "usys") +QDEF(MP_QSTR_utime, 40421, 5, "utime") +QDEF(MP_QSTR_version, 54207, 7, "version") +QDEF(MP_QSTR_version_info, 2670, 12, "version_info") diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/startup_stm32l431xx.s b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/startup_stm32l431xx.s new file mode 100644 index 00000000..6a5c15a5 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_basic_demo/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power devices vector table for MDK-ARM toolchain. +;* This module performs: +;* - Set the initial SP +;* - Set the initial PC == Reset_Handler +;* - Set the vector table entries with the exceptions ISR address +;* - Branches to __main in the C library (which eventually +;* calls main()). +;* After Reset the Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; Amount of memory (in bytes) allocated for Stack +; Tailor this value to your application needs +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x100 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x100 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDG_IRQHandler ; Window WatchDog + DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS interrupt + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +; Reset handler +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_PVM_IRQHandler [WEAK] + EXPORT TAMP_STAMP_IRQHandler [WEAK] + EXPORT RTC_WKUP_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT RCC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT DMA1_Channel5_IRQHandler [WEAK] + EXPORT DMA1_Channel6_IRQHandler [WEAK] + EXPORT DMA1_Channel7_IRQHandler [WEAK] + EXPORT ADC1_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT I2C2_EV_IRQHandler [WEAK] + EXPORT I2C2_ER_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_IRQHandler [WEAK] + EXPORT DMA2_Channel1_IRQHandler [WEAK] + EXPORT DMA2_Channel2_IRQHandler [WEAK] + EXPORT DMA2_Channel3_IRQHandler [WEAK] + EXPORT DMA2_Channel4_IRQHandler [WEAK] + EXPORT DMA2_Channel5_IRQHandler [WEAK] + EXPORT COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_IRQHandler +RTC_WKUP_IRQHandler +FLASH_IRQHandler +RCC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +DMA1_Channel5_IRQHandler +DMA1_Channel6_IRQHandler +DMA1_Channel7_IRQHandler +ADC1_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_IRQHandler + + B . + + ENDP + + ALIGN + +;******************************************************************************* +; User Stack and Heap initialization +;******************************************************************************* + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + END + +;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_STM32L31RC.uvoptx b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_STM32L31RC.uvoptx new file mode 100644 index 00000000..6c457c36 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_STM32L31RC.uvoptx @@ -0,0 +1,3519 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=75,104,525,661,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=120,153,378,741,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U066EFF3035344E5043163106 -O10446 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC8000 -FN2 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) -FF1BearPi_W25Q64JV -FS190000000 -FL1800000 + + + + + + 0 + 1 + tos_next_task + + + 1 + 1 + tos_rdyq.highest_prio + + + 2 + 1 + task_list + + + 3 + 1 + 0x20000280,0x10 + + + 4 + 1 + tos_rdyq.highest_prio + + + 5 + 1 + owner + + + 6 + 1 + tos_curr_task + + + 7 + 1 + highest_pending_prio + + + 8 + 1 + task + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 0 + 0 + 2 + 10000000 + + + + + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 0 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it_mpy.c + stm32l4xx_it_mpy.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\sdmmc.c + sdmmc.c + 0 + 0 + + + 2 + 12 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\quadspi.c + quadspi.c + 0 + 0 + + + + + examples + 0 + 0 + 0 + 0 + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\micropython_demo\micropython_demo.c + micropython_demo.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + stm32l4xx_hal_sd.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + stm32l4xx_hal_sd_ex.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + stm32l4xx_ll_sdmmc.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c + stm32l4xx_hal_qspi.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 42 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 43 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\BH1750\BH1750.c + BH1750.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c + lcd_spi2_drv.c + 0 + 0 + + + 6 + 45 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\W25QXX-QSPI\w25qxx.c + w25qxx.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 69 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + 7 + 70 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_stopwatch.c + tos_stopwatch.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 8 + 71 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 8 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 8 + 73 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + config + 0 + 0 + 0 + 0 + + 9 + 74 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + hal + 0 + 0 + 0 + 0 + + 10 + 75 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_uart.c + tos_hal_uart.c + 0 + 0 + + + 10 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + tos_hal_sd.c + 0 + 0 + + + 10 + 77 + 1 + 0 + 0 + 0 + ..\micropython_basic_demo\board\hal\mp_tos_hal_pin.c + mp_tos_hal_pin.c + 0 + 0 + + + 10 + 78 + 1 + 0 + 0 + 0 + ..\micropython_basic_demo\board\hal\mp_tos_hal_spi.c + mp_tos_hal_spi.c + 0 + 0 + + + 10 + 79 + 1 + 0 + 0 + 0 + ..\micropython_basic_demo\board\hal\mp_tos_hal_uart.c + mp_tos_hal_uart.c + 0 + 0 + + + + + net + 0 + 0 + 0 + 0 + + 11 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\net\at\src\tos_at.c + tos_at.c + 0 + 0 + + + 11 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\net\sal_module_wrapper\sal_module_wrapper.c + sal_module_wrapper.c + 0 + 0 + + + 11 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\net\socket_wrapper\tos_at_socket.c + tos_at_socket.c + 0 + 0 + + + 11 + 83 + 1 + 0 + 0 + 0 + ..\..\..\..\net\socket_wrapper\tos_at_socket_lib.c + tos_at_socket_lib.c + 0 + 0 + + + 11 + 84 + 1 + 0 + 0 + 0 + ..\..\..\..\net\socket_wrapper\tos_at_socket_prv.c + tos_at_socket_prv.c + 0 + 0 + + + + + devices + 0 + 0 + 0 + 0 + + 12 + 85 + 1 + 0 + 0 + 0 + ..\..\..\..\devices\esp8266\esp8266.c + esp8266.c + 0 + 0 + + + + + vfs + 0 + 0 + 0 + 0 + + 13 + 86 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs.c + tos_vfs.c + 0 + 0 + + + 13 + 87 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + tos_vfs_device.c + 0 + 0 + + + 13 + 88 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + tos_vfs_file.c + 0 + 0 + + + 13 + 89 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + tos_vfs_fs.c + 0 + 0 + + + 13 + 90 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + tos_vfs_inode.c + 0 + 0 + + + + + fatfs + 0 + 0 + 0 + 0 + + 14 + 91 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + tos_diskio.c + 0 + 0 + + + 14 + 92 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + tos_fatfs_drv.c + 0 + 0 + + + 14 + 93 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + tos_fatfs_vfs.c + 0 + 0 + + + 14 + 94 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + tos_ff.c + 0 + 0 + + + 14 + 95 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + tos_ffsystem.c + 0 + 0 + + + 14 + 96 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + tos_ffunicode.c + 0 + 0 + + + + + micropython/py + 0 + 0 + 0 + 0 + + 15 + 97 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\argcheck.c + argcheck.c + 0 + 0 + + + 15 + 98 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmarm.c + asmarm.c + 0 + 0 + + + 15 + 99 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmbase.c + asmbase.c + 0 + 0 + + + 15 + 100 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmthumb.c + asmthumb.c + 0 + 0 + + + 15 + 101 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmx64.c + asmx64.c + 0 + 0 + + + 15 + 102 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmx86.c + asmx86.c + 0 + 0 + + + 15 + 103 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\asmxtensa.c + asmxtensa.c + 0 + 0 + + + 15 + 104 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\bc.c + bc.c + 0 + 0 + + + 15 + 105 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\binary.c + binary.c + 0 + 0 + + + 15 + 106 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\builtinevex.c + builtinevex.c + 0 + 0 + + + 15 + 107 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\builtinhelp.c + builtinhelp.c + 0 + 0 + + + 15 + 108 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\builtinimport.c + builtinimport.c + 0 + 0 + + + 15 + 109 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\compile.c + compile.c + 0 + 0 + + + 15 + 110 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitbc.c + emitbc.c + 0 + 0 + + + 15 + 111 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitcommon.c + emitcommon.c + 0 + 0 + + + 15 + 112 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitglue.c + emitglue.c + 0 + 0 + + + 15 + 113 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitinlinethumb.c + emitinlinethumb.c + 0 + 0 + + + 15 + 114 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitinlinextensa.c + emitinlinextensa.c + 0 + 0 + + + 15 + 115 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnarm.c + emitnarm.c + 0 + 0 + + + 15 + 116 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnative.c + emitnative.c + 0 + 0 + + + 15 + 117 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnthumb.c + emitnthumb.c + 0 + 0 + + + 15 + 118 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnx64.c + emitnx64.c + 0 + 0 + + + 15 + 119 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnx86.c + emitnx86.c + 0 + 0 + + + 15 + 120 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnxtensa.c + emitnxtensa.c + 0 + 0 + + + 15 + 121 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\emitnxtensawin.c + emitnxtensawin.c + 0 + 0 + + + 15 + 122 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\formatfloat.c + formatfloat.c + 0 + 0 + + + 15 + 123 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\frozenmod.c + frozenmod.c + 0 + 0 + + + 15 + 124 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\gc.c + gc.c + 0 + 0 + + + 15 + 125 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\lexer.c + lexer.c + 0 + 0 + + + 15 + 126 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\malloc.c + malloc.c + 0 + 0 + + + 15 + 127 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\map.c + map.c + 0 + 0 + + + 15 + 128 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modarray.c + modarray.c + 0 + 0 + + + 15 + 129 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modbuiltins.c + modbuiltins.c + 0 + 0 + + + 15 + 130 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modcmath.c + modcmath.c + 0 + 0 + + + 15 + 131 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modcollections.c + modcollections.c + 0 + 0 + + + 15 + 132 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modgc.c + modgc.c + 0 + 0 + + + 15 + 133 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modio.c + modio.c + 0 + 0 + + + 15 + 134 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modmath.c + modmath.c + 0 + 0 + + + 15 + 135 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modmicropython.c + modmicropython.c + 0 + 0 + + + 15 + 136 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modstruct.c + modstruct.c + 0 + 0 + + + 15 + 137 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modsys.c + modsys.c + 0 + 0 + + + 15 + 138 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\modthread.c + modthread.c + 0 + 0 + + + 15 + 139 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\moduerrno.c + moduerrno.c + 0 + 0 + + + 15 + 140 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\mpprint.c + mpprint.c + 0 + 0 + + + 15 + 141 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\mpstate.c + mpstate.c + 0 + 0 + + + 15 + 142 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\mpz.c + mpz.c + 0 + 0 + + + 15 + 143 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nativeglue.c + nativeglue.c + 0 + 0 + + + 15 + 144 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlr.c + nlr.c + 0 + 0 + + + 15 + 145 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlraarch64.c + nlraarch64.c + 0 + 0 + + + 15 + 146 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrpowerpc.c + nlrpowerpc.c + 0 + 0 + + + 15 + 147 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrsetjmp.c + nlrsetjmp.c + 0 + 0 + + + 15 + 148 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrthumb.c + nlrthumb.c + 0 + 0 + + + 15 + 149 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrx64.c + nlrx64.c + 0 + 0 + + + 15 + 150 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrx86.c + nlrx86.c + 0 + 0 + + + 15 + 151 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\nlrxtensa.c + nlrxtensa.c + 0 + 0 + + + 15 + 152 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\obj.c + obj.c + 0 + 0 + + + 15 + 153 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objarray.c + objarray.c + 0 + 0 + + + 15 + 154 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objattrtuple.c + objattrtuple.c + 0 + 0 + + + 15 + 155 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objbool.c + objbool.c + 0 + 0 + + + 15 + 156 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objboundmeth.c + objboundmeth.c + 0 + 0 + + + 15 + 157 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objcell.c + objcell.c + 0 + 0 + + + 15 + 158 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objclosure.c + objclosure.c + 0 + 0 + + + 15 + 159 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objcomplex.c + objcomplex.c + 0 + 0 + + + 15 + 160 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objdeque.c + objdeque.c + 0 + 0 + + + 15 + 161 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objdict.c + objdict.c + 0 + 0 + + + 15 + 162 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objenumerate.c + objenumerate.c + 0 + 0 + + + 15 + 163 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objexcept.c + objexcept.c + 0 + 0 + + + 15 + 164 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objfilter.c + objfilter.c + 0 + 0 + + + 15 + 165 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objfloat.c + objfloat.c + 0 + 0 + + + 15 + 166 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objfun.c + objfun.c + 0 + 0 + + + 15 + 167 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objgenerator.c + objgenerator.c + 0 + 0 + + + 15 + 168 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objgetitemiter.c + objgetitemiter.c + 0 + 0 + + + 15 + 169 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objint.c + objint.c + 0 + 0 + + + 15 + 170 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objint_longlong.c + objint_longlong.c + 0 + 0 + + + 15 + 171 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objint_mpz.c + objint_mpz.c + 0 + 0 + + + 15 + 172 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objlist.c + objlist.c + 0 + 0 + + + 15 + 173 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objmap.c + objmap.c + 0 + 0 + + + 15 + 174 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objmodule.c + objmodule.c + 0 + 0 + + + 15 + 175 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objnamedtuple.c + objnamedtuple.c + 0 + 0 + + + 15 + 176 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objnone.c + objnone.c + 0 + 0 + + + 15 + 177 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objobject.c + objobject.c + 0 + 0 + + + 15 + 178 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objpolyiter.c + objpolyiter.c + 0 + 0 + + + 15 + 179 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objproperty.c + objproperty.c + 0 + 0 + + + 15 + 180 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objrange.c + objrange.c + 0 + 0 + + + 15 + 181 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objreversed.c + objreversed.c + 0 + 0 + + + 15 + 182 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objset.c + objset.c + 0 + 0 + + + 15 + 183 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objsingleton.c + objsingleton.c + 0 + 0 + + + 15 + 184 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objslice.c + objslice.c + 0 + 0 + + + 15 + 185 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objstr.c + objstr.c + 0 + 0 + + + 15 + 186 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objstringio.c + objstringio.c + 0 + 0 + + + 15 + 187 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objstrunicode.c + objstrunicode.c + 0 + 0 + + + 15 + 188 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objtuple.c + objtuple.c + 0 + 0 + + + 15 + 189 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objtype.c + objtype.c + 0 + 0 + + + 15 + 190 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\objzip.c + objzip.c + 0 + 0 + + + 15 + 191 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\opmethods.c + opmethods.c + 0 + 0 + + + 15 + 192 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\pairheap.c + pairheap.c + 0 + 0 + + + 15 + 193 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\parse.c + parse.c + 0 + 0 + + + 15 + 194 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\parsenum.c + parsenum.c + 0 + 0 + + + 15 + 195 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\parsenumbase.c + parsenumbase.c + 0 + 0 + + + 15 + 196 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\persistentcode.c + persistentcode.c + 0 + 0 + + + 15 + 197 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\profile.c + profile.c + 0 + 0 + + + 15 + 198 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\pystack.c + pystack.c + 0 + 0 + + + 15 + 199 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\qstr.c + qstr.c + 0 + 0 + + + 15 + 200 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\reader.c + reader.c + 0 + 0 + + + 15 + 201 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\repl.c + repl.c + 0 + 0 + + + 15 + 202 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\ringbuf.c + ringbuf.c + 0 + 0 + + + 15 + 203 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\runtime.c + runtime.c + 0 + 0 + + + 15 + 204 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\runtime_utils.c + runtime_utils.c + 0 + 0 + + + 15 + 205 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\scheduler.c + scheduler.c + 0 + 0 + + + 15 + 206 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\scope.c + scope.c + 0 + 0 + + + 15 + 207 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\sequence.c + sequence.c + 0 + 0 + + + 15 + 208 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\showbc.c + showbc.c + 0 + 0 + + + 15 + 209 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\smallint.c + smallint.c + 0 + 0 + + + 15 + 210 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\stackctrl.c + stackctrl.c + 0 + 0 + + + 15 + 211 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\stream.c + stream.c + 0 + 0 + + + 15 + 212 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\unicode.c + unicode.c + 0 + 0 + + + 15 + 213 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\vm.c + vm.c + 0 + 0 + + + 15 + 214 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\vstr.c + vstr.c + 0 + 0 + + + 15 + 215 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\py\warning.c + warning.c + 0 + 0 + + + + + micropython/shared + 0 + 0 + 0 + 0 + + 16 + 216 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\readline\readline.c + readline.c + 0 + 0 + + + 16 + 217 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\pyexec.c + pyexec.c + 0 + 0 + + + 16 + 218 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\stdout_helpers.c + stdout_helpers.c + 0 + 0 + + + 16 + 219 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\sys_stdio_mphal.c + sys_stdio_mphal.c + 0 + 0 + + + 16 + 220 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\runtime\interrupt_char.c + interrupt_char.c + 0 + 0 + + + 16 + 221 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\shared\netutils\netutils.c + netutils.c + 0 + 0 + + + + + micropython/extmod + 0 + 0 + 0 + 0 + + 17 + 222 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modframebuf.c + modframebuf.c + 0 + 0 + + + 17 + 223 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moduasyncio.c + moduasyncio.c + 0 + 0 + + + 17 + 224 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modubinascii.c + modubinascii.c + 0 + 0 + + + 17 + 225 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moductypes.c + moductypes.c + 0 + 0 + + + 17 + 226 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moduhashlib.c + moduhashlib.c + 0 + 0 + + + 17 + 227 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moduheapq.c + moduheapq.c + 0 + 0 + + + 17 + 228 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modujson.c + modujson.c + 0 + 0 + + + 17 + 229 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moduos.c + moduos.c + 0 + 0 + + + 17 + 230 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modurandom.c + modurandom.c + 0 + 0 + + + 17 + 231 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modure.c + modure.c + 0 + 0 + + + 17 + 232 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moduselect.c + moduselect.c + 0 + 0 + + + 17 + 233 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\moduzlib.c + moduzlib.c + 0 + 0 + + + 17 + 234 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\vfs.c + vfs.c + 0 + 0 + + + 17 + 235 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\vfs_reader.c + vfs_reader.c + 0 + 0 + + + 17 + 236 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\uos_dupterm.c + uos_dupterm.c + 0 + 0 + + + 17 + 237 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\utime_mphal.c + utime_mphal.c + 0 + 0 + + + 17 + 238 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\machine_signal.c + machine_signal.c + 0 + 0 + + + 17 + 239 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\virtpin.c + virtpin.c + 0 + 0 + + + 17 + 240 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\machine_mem.c + machine_mem.c + 0 + 0 + + + 17 + 241 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\machine_spi.c + machine_spi.c + 0 + 0 + + + 17 + 242 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\machine_i2c.c + machine_i2c.c + 0 + 0 + + + 17 + 243 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modnetwork.c + modnetwork.c + 0 + 0 + + + 17 + 244 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\extmod\modusocket.c + modusocket.c + 0 + 0 + + + + + micropython/drivers + 0 + 0 + 0 + 0 + + 18 + 245 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\drivers\bus\softspi.c + softspi.c + 0 + 0 + + + + + micropython/port + 0 + 0 + 0 + 0 + + 19 + 246 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\help.c + help.c + 0 + 0 + + + 19 + 247 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\mphalport.c + mphalport.c + 0 + 0 + + + 19 + 248 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\mpmain.c + mpmain.c + 0 + 0 + + + 19 + 249 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\mpthreadport.c + mpthreadport.c + 0 + 0 + + + 19 + 250 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_hw_spi.c + machine_hw_spi.c + 0 + 0 + + + 19 + 251 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_pin.c + machine_pin.c + 0 + 0 + + + 19 + 252 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_timer.c + machine_timer.c + 0 + 0 + + + 19 + 253 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\machine_uart.c + machine_uart.c + 0 + 0 + + + 19 + 254 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\modesp8266.c + modesp8266.c + 0 + 0 + + + 19 + 255 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\modmachine.c + modmachine.c + 0 + 0 + + + 19 + 256 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\modutime.c + modutime.c + 0 + 0 + + + 19 + 257 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos.c + vfs_tos.c + 0 + 0 + + + 19 + 258 + 1 + 0 + 0 + 0 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos_file.c + vfs_tos_file.c + 0 + 0 + + + 19 + 259 + 1 + 0 + 0 + 0 + ..\micropython_basic_demo\board\mphalboard.c + mphalboard.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_STM32L31RC.uvprojx b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_STM32L31RC.uvprojx new file mode 100644 index 00000000..a53dc0a3 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_STM32L31RC.uvprojx @@ -0,0 +1,2137 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.2.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + cmd.exe /C cd $P..\..\..\..\components\language\micropython\port & make clean-build V=1 + cmd.exe /C cd $P..\..\..\..\components\language\micropython\port & make genhdr V=1 PYTHON=python PORT_BOARD_DIR=$Pboard TARGET_GENHDR_DIR=$Pgenhdr + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x90000000 + 0x800000 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266,USE_MICROPYTHON + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\net\socket_wrapper\include;..\..\BSP\Hardware\LCD_ST7789;..\..\BSP\Hardware\BH1750;..\..\BSP\Hardware\W25QXX-QSPI;..\..\..\..\examples\micropython_demo;..\..\..\..\components\fs\vfs\include;..\..\..\..\components\fs\fatfs\wrapper\include;..\..\..\..\components\fs\fatfs\3rdparty;..\..\..\..\components\language\micropython;..\..\..\..\components\language\micropython\port;..\..\..\..\components\language\micropython\port\modules;..\micropython_extra_demo;.\board;.\board\hal + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + stm32l4xx_it_mpy.c + 1 + ..\..\BSP\Src\stm32l4xx_it_mpy.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + sdmmc.c + 1 + ..\..\BSP\Src\sdmmc.c + + + quadspi.c + 1 + ..\..\BSP\Src\quadspi.c + + + + + examples + + + micropython_demo.c + 1 + ..\..\..\..\examples\micropython_demo\micropython_demo.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + stm32l4xx_hal_sd.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + + + stm32l4xx_hal_sd_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + + + stm32l4xx_ll_sdmmc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + + + stm32l4xx_hal_qspi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + BH1750.c + 1 + ..\..\BSP\Hardware\BH1750\BH1750.c + + + lcd_spi2_drv.c + 1 + ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c + + + w25qxx.c + 1 + ..\..\BSP\Hardware\W25QXX-QSPI\w25qxx.c + + + + + kernel + + + tos_mmblk.c + 1 + ..\..\..\..\kernel\core\tos_mmblk.c + + + tos_mmheap.c + 1 + ..\..\..\..\kernel\core\tos_mmheap.c + + + tos_mutex.c + 1 + ..\..\..\..\kernel\core\tos_mutex.c + + + tos_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.c + + + tos_sys.c + 1 + ..\..\..\..\kernel\core\tos_sys.c + + + tos_task.c + 1 + ..\..\..\..\kernel\core\tos_task.c + + + tos_tick.c + 1 + ..\..\..\..\kernel\core\tos_tick.c + + + tos_time.c + 1 + ..\..\..\..\kernel\core\tos_time.c + + + tos_timer.c + 1 + ..\..\..\..\kernel\core\tos_timer.c + + + tos_event.c + 1 + ..\..\..\..\kernel\core\tos_event.c + + + tos_global.c + 1 + ..\..\..\..\kernel\core\tos_global.c + + + tos_pend.c + 1 + ..\..\..\..\kernel\core\tos_pend.c + + + tos_robin.c + 1 + ..\..\..\..\kernel\core\tos_robin.c + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.c + + + tos_char_fifo.c + 1 + ..\..\..\..\kernel\core\tos_char_fifo.c + + + tos_completion.c + 1 + ..\..\..\..\kernel\core\tos_completion.c + + + tos_countdownlatch.c + 1 + ..\..\..\..\kernel\core\tos_countdownlatch.c + + + tos_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_mail_queue.c + + + tos_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_message_queue.c + + + tos_priority_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + + + tos_priority_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + + + tos_priority_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_queue.c + + + tos_ring_queue.c + 1 + ..\..\..\..\kernel\core\tos_ring_queue.c + + + tos_stopwatch.c + 1 + ..\..\..\..\kernel\core\tos_stopwatch.c + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + tos_cpu.c + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + + port_c.c + 1 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + hal + + + tos_hal_uart.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_uart.c + + + tos_hal_sd.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + + + mp_tos_hal_pin.c + 1 + ..\micropython_basic_demo\board\hal\mp_tos_hal_pin.c + + + mp_tos_hal_spi.c + 1 + ..\micropython_basic_demo\board\hal\mp_tos_hal_spi.c + + + mp_tos_hal_uart.c + 1 + ..\micropython_basic_demo\board\hal\mp_tos_hal_uart.c + + + + + net + + + tos_at.c + 1 + ..\..\..\..\net\at\src\tos_at.c + + + sal_module_wrapper.c + 1 + ..\..\..\..\net\sal_module_wrapper\sal_module_wrapper.c + + + tos_at_socket.c + 1 + ..\..\..\..\net\socket_wrapper\tos_at_socket.c + + + tos_at_socket_lib.c + 1 + ..\..\..\..\net\socket_wrapper\tos_at_socket_lib.c + + + tos_at_socket_prv.c + 1 + ..\..\..\..\net\socket_wrapper\tos_at_socket_prv.c + + + + + devices + + + esp8266.c + 1 + ..\..\..\..\devices\esp8266\esp8266.c + + + + + vfs + + + tos_vfs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs.c + + + tos_vfs_device.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + + + tos_vfs_file.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + + + tos_vfs_fs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + + + tos_vfs_inode.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + + + + + fatfs + + + 0 + 1 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + tos_diskio.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + + + tos_fatfs_drv.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + + + tos_fatfs_vfs.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + + + tos_ff.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + + + tos_ffsystem.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + + + tos_ffunicode.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + + + + + micropython/py + + + 0 + 1 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + argcheck.c + 1 + ..\..\..\..\components\language\micropython\py\argcheck.c + + + asmarm.c + 1 + ..\..\..\..\components\language\micropython\py\asmarm.c + + + asmbase.c + 1 + ..\..\..\..\components\language\micropython\py\asmbase.c + + + asmthumb.c + 1 + ..\..\..\..\components\language\micropython\py\asmthumb.c + + + asmx64.c + 1 + ..\..\..\..\components\language\micropython\py\asmx64.c + + + asmx86.c + 1 + ..\..\..\..\components\language\micropython\py\asmx86.c + + + asmxtensa.c + 1 + ..\..\..\..\components\language\micropython\py\asmxtensa.c + + + bc.c + 1 + ..\..\..\..\components\language\micropython\py\bc.c + + + binary.c + 1 + ..\..\..\..\components\language\micropython\py\binary.c + + + builtinevex.c + 1 + ..\..\..\..\components\language\micropython\py\builtinevex.c + + + builtinhelp.c + 1 + ..\..\..\..\components\language\micropython\py\builtinhelp.c + + + builtinimport.c + 1 + ..\..\..\..\components\language\micropython\py\builtinimport.c + + + compile.c + 1 + ..\..\..\..\components\language\micropython\py\compile.c + + + emitbc.c + 1 + ..\..\..\..\components\language\micropython\py\emitbc.c + + + emitcommon.c + 1 + ..\..\..\..\components\language\micropython\py\emitcommon.c + + + emitglue.c + 1 + ..\..\..\..\components\language\micropython\py\emitglue.c + + + emitinlinethumb.c + 1 + ..\..\..\..\components\language\micropython\py\emitinlinethumb.c + + + emitinlinextensa.c + 1 + ..\..\..\..\components\language\micropython\py\emitinlinextensa.c + + + emitnarm.c + 1 + ..\..\..\..\components\language\micropython\py\emitnarm.c + + + emitnative.c + 1 + ..\..\..\..\components\language\micropython\py\emitnative.c + + + emitnthumb.c + 1 + ..\..\..\..\components\language\micropython\py\emitnthumb.c + + + emitnx64.c + 1 + ..\..\..\..\components\language\micropython\py\emitnx64.c + + + emitnx86.c + 1 + ..\..\..\..\components\language\micropython\py\emitnx86.c + + + emitnxtensa.c + 1 + ..\..\..\..\components\language\micropython\py\emitnxtensa.c + + + emitnxtensawin.c + 1 + ..\..\..\..\components\language\micropython\py\emitnxtensawin.c + + + formatfloat.c + 1 + ..\..\..\..\components\language\micropython\py\formatfloat.c + + + frozenmod.c + 1 + ..\..\..\..\components\language\micropython\py\frozenmod.c + + + gc.c + 1 + ..\..\..\..\components\language\micropython\py\gc.c + + + lexer.c + 1 + ..\..\..\..\components\language\micropython\py\lexer.c + + + malloc.c + 1 + ..\..\..\..\components\language\micropython\py\malloc.c + + + map.c + 1 + ..\..\..\..\components\language\micropython\py\map.c + + + modarray.c + 1 + ..\..\..\..\components\language\micropython\py\modarray.c + + + modbuiltins.c + 1 + ..\..\..\..\components\language\micropython\py\modbuiltins.c + + + modcmath.c + 1 + ..\..\..\..\components\language\micropython\py\modcmath.c + + + modcollections.c + 1 + ..\..\..\..\components\language\micropython\py\modcollections.c + + + modgc.c + 1 + ..\..\..\..\components\language\micropython\py\modgc.c + + + modio.c + 1 + ..\..\..\..\components\language\micropython\py\modio.c + + + modmath.c + 1 + ..\..\..\..\components\language\micropython\py\modmath.c + + + modmicropython.c + 1 + ..\..\..\..\components\language\micropython\py\modmicropython.c + + + modstruct.c + 1 + ..\..\..\..\components\language\micropython\py\modstruct.c + + + modsys.c + 1 + ..\..\..\..\components\language\micropython\py\modsys.c + + + modthread.c + 1 + ..\..\..\..\components\language\micropython\py\modthread.c + + + moduerrno.c + 1 + ..\..\..\..\components\language\micropython\py\moduerrno.c + + + mpprint.c + 1 + ..\..\..\..\components\language\micropython\py\mpprint.c + + + mpstate.c + 1 + ..\..\..\..\components\language\micropython\py\mpstate.c + + + mpz.c + 1 + ..\..\..\..\components\language\micropython\py\mpz.c + + + nativeglue.c + 1 + ..\..\..\..\components\language\micropython\py\nativeglue.c + + + nlr.c + 1 + ..\..\..\..\components\language\micropython\py\nlr.c + + + nlraarch64.c + 1 + ..\..\..\..\components\language\micropython\py\nlraarch64.c + + + nlrpowerpc.c + 1 + ..\..\..\..\components\language\micropython\py\nlrpowerpc.c + + + nlrsetjmp.c + 1 + ..\..\..\..\components\language\micropython\py\nlrsetjmp.c + + + nlrthumb.c + 1 + ..\..\..\..\components\language\micropython\py\nlrthumb.c + + + nlrx64.c + 1 + ..\..\..\..\components\language\micropython\py\nlrx64.c + + + nlrx86.c + 1 + ..\..\..\..\components\language\micropython\py\nlrx86.c + + + nlrxtensa.c + 1 + ..\..\..\..\components\language\micropython\py\nlrxtensa.c + + + obj.c + 1 + ..\..\..\..\components\language\micropython\py\obj.c + + + objarray.c + 1 + ..\..\..\..\components\language\micropython\py\objarray.c + + + objattrtuple.c + 1 + ..\..\..\..\components\language\micropython\py\objattrtuple.c + + + objbool.c + 1 + ..\..\..\..\components\language\micropython\py\objbool.c + + + objboundmeth.c + 1 + ..\..\..\..\components\language\micropython\py\objboundmeth.c + + + objcell.c + 1 + ..\..\..\..\components\language\micropython\py\objcell.c + + + objclosure.c + 1 + ..\..\..\..\components\language\micropython\py\objclosure.c + + + objcomplex.c + 1 + ..\..\..\..\components\language\micropython\py\objcomplex.c + + + objdeque.c + 1 + ..\..\..\..\components\language\micropython\py\objdeque.c + + + objdict.c + 1 + ..\..\..\..\components\language\micropython\py\objdict.c + + + objenumerate.c + 1 + ..\..\..\..\components\language\micropython\py\objenumerate.c + + + objexcept.c + 1 + ..\..\..\..\components\language\micropython\py\objexcept.c + + + objfilter.c + 1 + ..\..\..\..\components\language\micropython\py\objfilter.c + + + objfloat.c + 1 + ..\..\..\..\components\language\micropython\py\objfloat.c + + + objfun.c + 1 + ..\..\..\..\components\language\micropython\py\objfun.c + + + objgenerator.c + 1 + ..\..\..\..\components\language\micropython\py\objgenerator.c + + + objgetitemiter.c + 1 + ..\..\..\..\components\language\micropython\py\objgetitemiter.c + + + objint.c + 1 + ..\..\..\..\components\language\micropython\py\objint.c + + + objint_longlong.c + 1 + ..\..\..\..\components\language\micropython\py\objint_longlong.c + + + objint_mpz.c + 1 + ..\..\..\..\components\language\micropython\py\objint_mpz.c + + + objlist.c + 1 + ..\..\..\..\components\language\micropython\py\objlist.c + + + objmap.c + 1 + ..\..\..\..\components\language\micropython\py\objmap.c + + + objmodule.c + 1 + ..\..\..\..\components\language\micropython\py\objmodule.c + + + objnamedtuple.c + 1 + ..\..\..\..\components\language\micropython\py\objnamedtuple.c + + + objnone.c + 1 + ..\..\..\..\components\language\micropython\py\objnone.c + + + objobject.c + 1 + ..\..\..\..\components\language\micropython\py\objobject.c + + + objpolyiter.c + 1 + ..\..\..\..\components\language\micropython\py\objpolyiter.c + + + objproperty.c + 1 + ..\..\..\..\components\language\micropython\py\objproperty.c + + + objrange.c + 1 + ..\..\..\..\components\language\micropython\py\objrange.c + + + objreversed.c + 1 + ..\..\..\..\components\language\micropython\py\objreversed.c + + + objset.c + 1 + ..\..\..\..\components\language\micropython\py\objset.c + + + objsingleton.c + 1 + ..\..\..\..\components\language\micropython\py\objsingleton.c + + + objslice.c + 1 + ..\..\..\..\components\language\micropython\py\objslice.c + + + objstr.c + 1 + ..\..\..\..\components\language\micropython\py\objstr.c + + + objstringio.c + 1 + ..\..\..\..\components\language\micropython\py\objstringio.c + + + objstrunicode.c + 1 + ..\..\..\..\components\language\micropython\py\objstrunicode.c + + + objtuple.c + 1 + ..\..\..\..\components\language\micropython\py\objtuple.c + + + objtype.c + 1 + ..\..\..\..\components\language\micropython\py\objtype.c + + + objzip.c + 1 + ..\..\..\..\components\language\micropython\py\objzip.c + + + opmethods.c + 1 + ..\..\..\..\components\language\micropython\py\opmethods.c + + + pairheap.c + 1 + ..\..\..\..\components\language\micropython\py\pairheap.c + + + parse.c + 1 + ..\..\..\..\components\language\micropython\py\parse.c + + + parsenum.c + 1 + ..\..\..\..\components\language\micropython\py\parsenum.c + + + parsenumbase.c + 1 + ..\..\..\..\components\language\micropython\py\parsenumbase.c + + + persistentcode.c + 1 + ..\..\..\..\components\language\micropython\py\persistentcode.c + + + profile.c + 1 + ..\..\..\..\components\language\micropython\py\profile.c + + + pystack.c + 1 + ..\..\..\..\components\language\micropython\py\pystack.c + + + qstr.c + 1 + ..\..\..\..\components\language\micropython\py\qstr.c + + + reader.c + 1 + ..\..\..\..\components\language\micropython\py\reader.c + + + repl.c + 1 + ..\..\..\..\components\language\micropython\py\repl.c + + + ringbuf.c + 1 + ..\..\..\..\components\language\micropython\py\ringbuf.c + + + runtime.c + 1 + ..\..\..\..\components\language\micropython\py\runtime.c + + + runtime_utils.c + 1 + ..\..\..\..\components\language\micropython\py\runtime_utils.c + + + scheduler.c + 1 + ..\..\..\..\components\language\micropython\py\scheduler.c + + + scope.c + 1 + ..\..\..\..\components\language\micropython\py\scope.c + + + sequence.c + 1 + ..\..\..\..\components\language\micropython\py\sequence.c + + + showbc.c + 1 + ..\..\..\..\components\language\micropython\py\showbc.c + + + smallint.c + 1 + ..\..\..\..\components\language\micropython\py\smallint.c + + + stackctrl.c + 1 + ..\..\..\..\components\language\micropython\py\stackctrl.c + + + stream.c + 1 + ..\..\..\..\components\language\micropython\py\stream.c + + + unicode.c + 1 + ..\..\..\..\components\language\micropython\py\unicode.c + + + vm.c + 1 + ..\..\..\..\components\language\micropython\py\vm.c + + + vstr.c + 1 + ..\..\..\..\components\language\micropython\py\vstr.c + + + warning.c + 1 + ..\..\..\..\components\language\micropython\py\warning.c + + + + + micropython/shared + + + 0 + 1 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + readline.c + 1 + ..\..\..\..\components\language\micropython\shared\readline\readline.c + + + pyexec.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\pyexec.c + + + stdout_helpers.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\stdout_helpers.c + + + sys_stdio_mphal.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\sys_stdio_mphal.c + + + interrupt_char.c + 1 + ..\..\..\..\components\language\micropython\shared\runtime\interrupt_char.c + + + netutils.c + 1 + ..\..\..\..\components\language\micropython\shared\netutils\netutils.c + + + + + micropython/extmod + + + 0 + 1 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + modframebuf.c + 1 + ..\..\..\..\components\language\micropython\extmod\modframebuf.c + + + moduasyncio.c + 1 + ..\..\..\..\components\language\micropython\extmod\moduasyncio.c + + + modubinascii.c + 1 + ..\..\..\..\components\language\micropython\extmod\modubinascii.c + + + moductypes.c + 1 + ..\..\..\..\components\language\micropython\extmod\moductypes.c + + + moduhashlib.c + 1 + ..\..\..\..\components\language\micropython\extmod\moduhashlib.c + + + moduheapq.c + 1 + ..\..\..\..\components\language\micropython\extmod\moduheapq.c + + + modujson.c + 1 + ..\..\..\..\components\language\micropython\extmod\modujson.c + + + moduos.c + 1 + ..\..\..\..\components\language\micropython\extmod\moduos.c + + + modurandom.c + 1 + ..\..\..\..\components\language\micropython\extmod\modurandom.c + + + modure.c + 1 + ..\..\..\..\components\language\micropython\extmod\modure.c + + + moduselect.c + 1 + ..\..\..\..\components\language\micropython\extmod\moduselect.c + + + moduzlib.c + 1 + ..\..\..\..\components\language\micropython\extmod\moduzlib.c + + + vfs.c + 1 + ..\..\..\..\components\language\micropython\extmod\vfs.c + + + vfs_reader.c + 1 + ..\..\..\..\components\language\micropython\extmod\vfs_reader.c + + + uos_dupterm.c + 1 + ..\..\..\..\components\language\micropython\extmod\uos_dupterm.c + + + utime_mphal.c + 1 + ..\..\..\..\components\language\micropython\extmod\utime_mphal.c + + + machine_signal.c + 1 + ..\..\..\..\components\language\micropython\extmod\machine_signal.c + + + virtpin.c + 1 + ..\..\..\..\components\language\micropython\extmod\virtpin.c + + + machine_mem.c + 1 + ..\..\..\..\components\language\micropython\extmod\machine_mem.c + + + machine_spi.c + 1 + ..\..\..\..\components\language\micropython\extmod\machine_spi.c + + + machine_i2c.c + 1 + ..\..\..\..\components\language\micropython\extmod\machine_i2c.c + + + modnetwork.c + 1 + ..\..\..\..\components\language\micropython\extmod\modnetwork.c + + + modusocket.c + 1 + ..\..\..\..\components\language\micropython\extmod\modusocket.c + + + + + micropython/drivers + + + 0 + 1 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + softspi.c + 1 + ..\..\..\..\components\language\micropython\drivers\bus\softspi.c + + + + + micropython/port + + + help.c + 1 + ..\..\..\..\components\language\micropython\port\help.c + + + mphalport.c + 1 + ..\..\..\..\components\language\micropython\port\mphalport.c + + + mpmain.c + 1 + ..\..\..\..\components\language\micropython\port\mpmain.c + + + mpthreadport.c + 1 + ..\..\..\..\components\language\micropython\port\mpthreadport.c + + + machine_hw_spi.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_hw_spi.c + + + machine_pin.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_pin.c + + + machine_timer.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_timer.c + + + machine_uart.c + 1 + ..\..\..\..\components\language\micropython\port\modules\machine_uart.c + + + modesp8266.c + 1 + ..\..\..\..\components\language\micropython\port\modules\modesp8266.c + + + modmachine.c + 1 + ..\..\..\..\components\language\micropython\port\modules\modmachine.c + + + modutime.c + 1 + ..\..\..\..\components\language\micropython\port\modules\modutime.c + + + vfs_tos.c + 1 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos.c + + + vfs_tos_file.c + 1 + ..\..\..\..\components\language\micropython\port\modules\vfs_tos_file.c + + + mphalboard.c + 1 + ..\micropython_basic_demo\board\mphalboard.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_W25Q64JV.FLM b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_W25Q64JV.FLM new file mode 100644 index 00000000..5b629cb7 Binary files /dev/null and b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/BearPi_W25Q64JV.FLM differ diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_pin.c b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_pin.c new file mode 100644 index 00000000..1090378b --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_pin.c @@ -0,0 +1,273 @@ +#include "tos_k.h" +#include "mp_tos_hal_pin.h" +#include "gpio.h" + +#define ST_EXTI_VECTOR_SIZE 16 + +#define ST_PORT_NUM(port) ((uint8_t)((port) >> 4) & 0x0F) +#define ST_PIN_NUM(port) ((uint8_t)((port) & 0x0F)) + +__STATIC__ hal_pin_cb_t hal_pin_irq_handler[ST_EXTI_VECTOR_SIZE]; +__STATIC__ void *hal_pin_irq_handler_arg[ST_EXTI_VECTOR_SIZE]; +__STATIC__ GPIO_TypeDef *hal_pin_irq_gpio[ST_EXTI_VECTOR_SIZE]; + +__STATIC__ const uint8_t nvic_irq_channel[ST_EXTI_VECTOR_SIZE] = { + EXTI0_IRQn, EXTI1_IRQn, EXTI2_IRQn, EXTI3_IRQn, + EXTI4_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, + EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, + EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, +}; + +__STATIC__ int mask2no(uint32_t mask) { + for (int i = 0; i < 32; i++) { + if ((1U << i) == mask) { + return i; + } + } + return -1; +} + +__API__ int tos_hal_pin_init(hal_pin_t *pin, hal_pin_port_t port, hal_pin_mode_t mode) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + GPIO_InitTypeDef gpio_init; + + if (!pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)(GPIOA_BASE + ST_PORT_NUM(port) * 0x0400UL); + gpio_pin = 1UL << ST_PIN_NUM(port); + + gpio_init.Pin = gpio_pin; + gpio_init.Speed = GPIO_SPEED_FREQ_HIGH; + switch (mode) { + case HAL_PIN_MODE_OUTPUT: + gpio_init.Mode = GPIO_MODE_OUTPUT_PP; + gpio_init.Pull = GPIO_NOPULL; + break; + case HAL_PIN_MODE_OUTPUT_OD: + gpio_init.Mode = GPIO_MODE_OUTPUT_OD; + gpio_init.Pull = GPIO_NOPULL; + break; + case HAL_PIN_MODE_INPUT: + gpio_init.Mode = GPIO_MODE_INPUT; + gpio_init.Pull = GPIO_NOPULL; + break; + case HAL_PIN_MODE_INPUT_PULLUP: + gpio_init.Mode = GPIO_MODE_INPUT; + gpio_init.Pull = GPIO_PULLUP; + break; + case HAL_PIN_MODE_INPUT_PULLDOWN: + gpio_init.Mode = GPIO_MODE_INPUT; + gpio_init.Pull = GPIO_PULLDOWN; + break; + default: + return -1; + } + HAL_GPIO_Init((GPIO_TypeDef *)gpiox, &gpio_init); + + pin->port = port; + pin->private_gpio = gpiox; + pin->private_pin = gpio_pin; + pin->mode = mode; + + return 0; +} + +__API__ int tos_hal_pin_irq(hal_pin_t *pin, hal_pin_irq_t irq) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + uint32_t gpio_pin_num; + GPIO_InitTypeDef gpio_init; + TOS_CPU_CPSR_ALLOC(); + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + gpio_pin_num = mask2no(gpio_pin); + if (gpio_pin_num >= ST_EXTI_VECTOR_SIZE) { + return -1; + } + + TOS_CPU_INT_DISABLE(); + if (hal_pin_irq_gpio[gpio_pin_num] != NULL && hal_pin_irq_gpio[gpio_pin_num] != gpiox) { + TOS_CPU_INT_ENABLE(); + return -1; + } + + if (irq == HAL_PIN_IRQ_NONE) { + hal_pin_irq_gpio[gpio_pin_num] = NULL; + hal_pin_irq_handler[gpio_pin_num] = NULL; + hal_pin_irq_handler_arg[gpio_pin_num] = NULL; + TOS_CPU_INT_ENABLE(); + HAL_NVIC_DisableIRQ(nvic_irq_channel[gpio_pin_num]); + } else { + hal_pin_irq_gpio[gpio_pin_num] = gpiox; + TOS_CPU_INT_ENABLE(); + gpio_init.Pin = gpio_pin; + gpio_init.Speed = GPIO_SPEED_FREQ_HIGH; + gpio_init.Mode = GPIO_MODE_IT_RISING_FALLING; + switch (irq) { + case HAL_PIN_IRQ_RISING: + gpio_init.Mode = GPIO_MODE_IT_RISING; + break; + case HAL_PIN_IRQ_FALLING: + gpio_init.Mode = GPIO_MODE_IT_FALLING; + break; + case HAL_PIN_IRQ_RISING_FALLING: + gpio_init.Mode = GPIO_MODE_IT_RISING_FALLING; + break; + } + switch (pin->mode) { + case HAL_PIN_MODE_INPUT_PULLUP: + gpio_init.Pull = GPIO_PULLUP; + break; + case HAL_PIN_MODE_INPUT_PULLDOWN: + gpio_init.Pull = GPIO_PULLDOWN; + break; + default: + gpio_init.Pull = GPIO_NOPULL; + break; + } + HAL_GPIO_Init(gpiox, &gpio_init); + HAL_NVIC_SetPriority(nvic_irq_channel[gpio_pin_num], 2, 0); + HAL_NVIC_EnableIRQ(nvic_irq_channel[gpio_pin_num]); + + pin->irq = irq; + } + + return 0; +} + +__API__ int tos_hal_pin_irq_callback(hal_pin_t *pin, hal_pin_cb_t callback, void *cb_arg) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + uint32_t gpio_pin_num; + TOS_CPU_CPSR_ALLOC(); + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + gpio_pin_num = mask2no(gpio_pin); + if (gpio_pin_num >= ST_EXTI_VECTOR_SIZE) { + return -1; + } + + TOS_CPU_INT_DISABLE(); + if (hal_pin_irq_gpio[gpio_pin_num] != NULL && hal_pin_irq_gpio[gpio_pin_num] != gpiox) { + TOS_CPU_INT_ENABLE(); + return -1; + } + hal_pin_irq_handler[gpio_pin_num] = gpiox; + hal_pin_irq_handler[gpio_pin_num] = callback; + hal_pin_irq_handler_arg[gpio_pin_num] = cb_arg; + TOS_CPU_INT_ENABLE(); + + return 0; +} + +__API__ int tos_hal_pin_write(hal_pin_t *pin, int state) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + + HAL_GPIO_WritePin(gpiox, gpio_pin, (state == 0) ? GPIO_PIN_RESET : GPIO_PIN_SET); + + return 0; +} + +__API__ int tos_hal_pin_read(hal_pin_t *pin) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + + return (HAL_GPIO_ReadPin(gpiox, gpio_pin) == GPIO_PIN_RESET) ? 0 : 1; +} + +__API__ int tos_hal_pin_deinit(hal_pin_t *pin) +{ + GPIO_TypeDef *gpiox; + uint32_t gpio_pin; + uint32_t gpio_pin_num; + TOS_CPU_CPSR_ALLOC(); + + if (!pin) { + return -1; + } + + if (!pin->private_gpio || !pin->private_pin) { + return -1; + } + + gpiox = (GPIO_TypeDef *)pin->private_gpio; + gpio_pin = (uint32_t)pin->private_pin; + gpio_pin_num = mask2no(gpio_pin); + + TOS_CPU_INT_DISABLE(); + if (hal_pin_irq_gpio[gpio_pin_num] == gpiox) { + hal_pin_irq_gpio[gpio_pin_num] = NULL; + hal_pin_irq_handler[gpio_pin_num] = NULL; + hal_pin_irq_handler_arg[gpio_pin_num] = NULL; + } + TOS_CPU_INT_ENABLE(); + HAL_GPIO_DeInit(gpiox, gpio_pin); + + return 0; +} + +void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) +{ + uint32_t gpio_pin_num = mask2no(GPIO_Pin); + hal_pin_cb_t callback; + uint32_t cb_arg; + if (gpio_pin_num < ST_EXTI_VECTOR_SIZE) { + + callback = hal_pin_irq_handler[gpio_pin_num]; + cb_arg = hal_pin_irq_handler_arg[gpio_pin_num]; + if (callback) { + callback(cb_arg); + } + } +} + + diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_pin.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_pin.h new file mode 100644 index 00000000..6ac564d1 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_pin.h @@ -0,0 +1,45 @@ +#ifndef _TOS_HAL_PIN_H_ +#define _TOS_HAL_PIN_H_ + +typedef unsigned char hal_pin_port_t; + +typedef enum hal_pin_mode_en { + HAL_PIN_MODE_OUTPUT = 0, + HAL_PIN_MODE_OUTPUT_OD, + HAL_PIN_MODE_INPUT, + HAL_PIN_MODE_INPUT_PULLUP, + HAL_PIN_MODE_INPUT_PULLDOWN, +} hal_pin_mode_t; + +typedef enum hal_pin_irq_en { + HAL_PIN_IRQ_NONE = 0x00, + HAL_PIN_IRQ_RISING = 0x01, + HAL_PIN_IRQ_FALLING = 0x02, + HAL_PIN_IRQ_RISING_FALLING = 0x03, +} hal_pin_irq_t; + +typedef struct hal_pin_st { + hal_pin_port_t port; + void *private_gpio; + void *private_pin; + hal_pin_mode_t mode; + hal_pin_irq_t irq; +} hal_pin_t; + + +typedef void (*hal_pin_cb_t)(void *arg); + +__API__ int tos_hal_pin_init(hal_pin_t *pin, hal_pin_port_t port, hal_pin_mode_t mode); + +__API__ int tos_hal_pin_write(hal_pin_t *pin, int state); + +__API__ int tos_hal_pin_read(hal_pin_t *pin); + +__API__ int tos_hal_pin_mode(hal_pin_t *pin, hal_pin_mode_t mode); + +__API__ int tos_hal_pin_irq(hal_pin_t *pin, hal_pin_irq_t irq); + +__API__ int tos_hal_pin_irq_callback(hal_pin_t *pin, hal_pin_cb_t callback, void *cb_arg); + + +#endif diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_spi.c b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_spi.c new file mode 100644 index 00000000..b4f58be9 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_spi.c @@ -0,0 +1,80 @@ +#include "tos_k.h" +#include "mp_tos_hal_spi.h" +#include "stm32l4xx_hal.h" +#include "spi.h" + +__API__ int tos_hal_spi_init(hal_spi_t *spi, hal_spi_port_t port) +{ + if (!spi) { + return -1; + } + + if (port == HAL_SPI_PORT_1) { + spi->private_spi = &hspi1; + MX_SPI1_Init(); + } else if (port == HAL_SPI_PORT_2) { + spi->private_spi = &hspi2; + MX_SPI2_Init(); + } else if (port == HAL_SPI_PORT_3) { + spi->private_spi = &hspi3; + MX_SPI3_Init(); + } else { + return -1; + } + + return 0; +} + +__API__ int tos_hal_spi_transfer(hal_spi_t *spi, const uint8_t *send_buf, uint8_t *recv_buf, size_t size, uint32_t timeout) +{ + HAL_StatusTypeDef hal_status; + SPI_HandleTypeDef *spi_handle; + + if (!spi || (!send_buf && !recv_buf)) { + return -1; + } + + if (!spi->private_spi) { + return -1; + } + + spi_handle = (SPI_HandleTypeDef *)spi->private_spi; + + if (send_buf && recv_buf) { + hal_status = HAL_SPI_TransmitReceive(spi_handle, send_buf, recv_buf, size, timeout); + } else if (send_buf) { + hal_status = HAL_SPI_Transmit(spi_handle, send_buf, size, timeout); + } else if (recv_buf) { + hal_status = HAL_SPI_Receive(spi_handle, send_buf, size, timeout); + } + + if (hal_status != HAL_OK) { + return -1; + } + return 0; +} + +__API__ int tos_hal_spi_deinit(hal_spi_t *spi) +{ + HAL_StatusTypeDef hal_status; + SPI_HandleTypeDef *spi_handle; + + if (!spi) { + return -1; + } + + if (!spi->private_spi) { + return -1; + } + + spi_handle = (SPI_HandleTypeDef *)spi->private_spi; + + hal_status = HAL_SPI_DeInit(spi_handle); + HAL_SPI_MspDeInit(spi_handle); + + if (hal_status != HAL_OK) { + return -1; + } + + return 0; +} diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_spi.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_spi.h new file mode 100644 index 00000000..6dad4e9f --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_spi.h @@ -0,0 +1,22 @@ +#ifndef _TOS_HAL_SPI_H_ +#define _TOS_HAL_SPI_H_ + +typedef enum hal_spi_port_en { + HAL_SPI_PORT_0 = 0, + HAL_SPI_PORT_1, + HAL_SPI_PORT_2, + HAL_SPI_PORT_3, +} hal_spi_port_t; + +typedef struct hal_spi_st { + hal_spi_port_t port; + void *private_spi; +} hal_spi_t; + +__API__ int tos_hal_spi_init(hal_spi_t *spi, hal_spi_port_t port); + +__API__ int tos_hal_spi_transfer(hal_spi_t *spi, const uint8_t *send_buf, uint8_t *recv_buf, size_t size, uint32_t timeout); + +__API__ int tos_hal_spi_deinit(hal_spi_t *spi); + +#endif diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_uart.c b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_uart.c new file mode 100644 index 00000000..a86dd40d --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_uart.c @@ -0,0 +1,26 @@ +#include "tos_k.h" +#include "mp_tos_hal_uart.h" +#include "stm32l4xx_hal.h" +#include "usart.h" + +__API__ int tos_hal_uart_recv_start(hal_uart_t *uart, const uint8_t *buf, size_t size) +{ + HAL_StatusTypeDef hal_status; + UART_HandleTypeDef *uart_handle; + + if (!uart || !buf) { + return -1; + } + + if (!uart->private_uart) { + return -1; + } + + uart_handle = (UART_HandleTypeDef *)uart->private_uart; + + hal_status = HAL_UART_Receive_IT(uart_handle, (uint8_t *)buf, size); + if (hal_status != HAL_OK) { + return -1; + } + return 0; +} diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_uart.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_uart.h new file mode 100644 index 00000000..31b79dbf --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/hal/mp_tos_hal_uart.h @@ -0,0 +1,8 @@ +#ifndef _MP_TOS_HAL_UART_H_ +#define _MP_TOS_HAL_UART_H_ + +#include "tos_hal_uart.h" + +__API__ int tos_hal_uart_recv_start(hal_uart_t *uart, const uint8_t *buf, size_t size); + +#endif diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mpconfigboard.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mpconfigboard.h new file mode 100644 index 00000000..33fba638 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mpconfigboard.h @@ -0,0 +1,16 @@ +/* board specific config */ +#define MICROPY_HW_BOARD_NAME "BearPi" +#define MICROPY_HW_MCU_NAME "STM32F431RC" + +#define MICROPY_HW_UART_NUM 4 +#define MICROPY_HW_UART_REPL 2 +#define MICROPY_HW_SPI_NUM 4 + +/* project specific config */ +#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES) + +#define MP_USING_QSPI_FLASH +#define MP_USING_VFS +#define MP_USING_NETWORK +#define MP_USING_MACHINE_SPI +#define MP_USING_MACHINE_I2C diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mpconfigboard.mk b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mpconfigboard.mk new file mode 100644 index 00000000..e69de29b diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mphalboard.c b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mphalboard.c new file mode 100644 index 00000000..58d8f0a0 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mphalboard.c @@ -0,0 +1,109 @@ + +#include "py/mpconfig.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + +#include "modmachine.h" + +#if !(MP_GEN_HDR) +#include "tos_k.h" +#include "main.h" +#endif + +/********************** Tick *************************/ + +static uint32_t systick_get_us() { + // get systick value + uint32_t counter = SysTick->VAL; + uint32_t load = SysTick->LOAD; + + // convert from decrementing to incrementing + counter = load - counter; + + return (counter * 1000) / (load + 1); +} + +mp_uint_t mp_hal_ticks_us(void) { + uint32_t ms = tos_tick2millisec(tos_systick_get()); + uint32_t us = systick_get_us(); + return ms * 1000 + us; +} + +void mp_hal_delay_us(mp_uint_t usec) { + mp_uint_t ms = usec / 1000; + mp_uint_t us = usec % 1000; + if (ms > 0) + mp_hal_delay_ms(ms); + mp_uint_t start = mp_hal_ticks_us(); + while (mp_hal_ticks_us() - start < us) { + } +} + +/********************** GPIO *************************/ + +#define ST_PIN(port_num, pin_num) ((uint8_t)(((port_num) << 4) & 0xF0) | ((pin_num) & 0x0F)) + +STATIC const mp_rom_map_elem_t machine_pins_locals_dict_table[] = { + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_INT(ST_PIN(0, 0)) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_INT(ST_PIN(0, 1)) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_INT(ST_PIN(0, 2)) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_INT(ST_PIN(0, 3)) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_INT(ST_PIN(0, 4)) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_INT(ST_PIN(0, 5)) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_INT(ST_PIN(0, 6)) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_INT(ST_PIN(0, 7)) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_INT(ST_PIN(0, 8)) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_INT(ST_PIN(0, 9)) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_INT(ST_PIN(0, 10)) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_INT(ST_PIN(0, 11)) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_INT(ST_PIN(0, 12)) }, + { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_INT(ST_PIN(0, 13)) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_INT(ST_PIN(0, 14)) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_INT(ST_PIN(0, 15)) }, + + { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_INT(ST_PIN(1, 0)) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_INT(ST_PIN(1, 1)) }, + { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_INT(ST_PIN(1, 2)) }, + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_INT(ST_PIN(1, 3)) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_INT(ST_PIN(1, 4)) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_INT(ST_PIN(1, 5)) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_INT(ST_PIN(1, 6)) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_INT(ST_PIN(1, 7)) }, + { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_INT(ST_PIN(1, 8)) }, + { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_INT(ST_PIN(1, 9)) }, + { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_INT(ST_PIN(1, 10)) }, + { MP_ROM_QSTR(MP_QSTR_B11), MP_ROM_INT(ST_PIN(1, 11)) }, + { MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_INT(ST_PIN(1, 12)) }, + { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_INT(ST_PIN(1, 13)) }, + { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_INT(ST_PIN(1, 14)) }, + { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_INT(ST_PIN(1, 15)) }, + + { MP_ROM_QSTR(MP_QSTR_C0), MP_ROM_INT(ST_PIN(2, 0)) }, + { MP_ROM_QSTR(MP_QSTR_C1), MP_ROM_INT(ST_PIN(2, 1)) }, + { MP_ROM_QSTR(MP_QSTR_C2), MP_ROM_INT(ST_PIN(2, 2)) }, + { MP_ROM_QSTR(MP_QSTR_C3), MP_ROM_INT(ST_PIN(2, 3)) }, + { MP_ROM_QSTR(MP_QSTR_C4), MP_ROM_INT(ST_PIN(2, 4)) }, + { MP_ROM_QSTR(MP_QSTR_C5), MP_ROM_INT(ST_PIN(2, 5)) }, + { MP_ROM_QSTR(MP_QSTR_C6), MP_ROM_INT(ST_PIN(2, 6)) }, + { MP_ROM_QSTR(MP_QSTR_C7), MP_ROM_INT(ST_PIN(2, 7)) }, + { MP_ROM_QSTR(MP_QSTR_C8), MP_ROM_INT(ST_PIN(2, 8)) }, + { MP_ROM_QSTR(MP_QSTR_C9), MP_ROM_INT(ST_PIN(2, 9)) }, + { MP_ROM_QSTR(MP_QSTR_C10), MP_ROM_INT(ST_PIN(2, 10)) }, + { MP_ROM_QSTR(MP_QSTR_C11), MP_ROM_INT(ST_PIN(2, 11)) }, + { MP_ROM_QSTR(MP_QSTR_C12), MP_ROM_INT(ST_PIN(2, 12)) }, + { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_INT(ST_PIN(2, 13)) }, + { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_INT(ST_PIN(2, 14)) }, + { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_INT(ST_PIN(2, 15)) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_INT(ST_PIN(3, 2)) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_INT(ST_PIN(2, 13)) }, // C13 + { MP_ROM_QSTR(MP_QSTR_KEY1), MP_ROM_INT(ST_PIN(1, 2)) }, // B2 + { MP_ROM_QSTR(MP_QSTR_KEY2), MP_ROM_INT(ST_PIN(1, 3)) }, // B3 + +}; +MP_DEFINE_CONST_DICT(machine_pins_locals_dict, machine_pins_locals_dict_table); + + diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mphalboard.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mphalboard.h new file mode 100644 index 00000000..bebb5f6d --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/board/mphalboard.h @@ -0,0 +1,11 @@ +#ifndef _MPHALBOARD_H_ +#define _MPHALBOARD_H_ + +#include "py/obj.h" + +extern mp_uint_t mp_hal_ticks_us(void); +extern void mp_hal_delay_us(mp_uint_t usec); + +extern const mp_obj_dict_t machine_pins_locals_dict; + +#endif /* _MPHALBOARD_H_ */ diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/moduledefs.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/moduledefs.h new file mode 100644 index 00000000..6cc5d240 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/moduledefs.h @@ -0,0 +1,150 @@ +// Automatically generated by makemoduledefs.py. + +extern const struct _mp_obj_module_t mp_module___main__; +#undef MODULE_DEF_MP_QSTR___MAIN__ +#define MODULE_DEF_MP_QSTR___MAIN__ { MP_ROM_QSTR(MP_QSTR___main__), MP_ROM_PTR(&mp_module___main__) }, + +extern const struct _mp_obj_module_t mp_module_thread; +#undef MODULE_DEF_MP_QSTR__THREAD +#define MODULE_DEF_MP_QSTR__THREAD { MP_ROM_QSTR(MP_QSTR__thread), MP_ROM_PTR(&mp_module_thread) }, + +extern const struct _mp_obj_module_t mp_module_uasyncio; +#undef MODULE_DEF_MP_QSTR__UASYNCIO +#define MODULE_DEF_MP_QSTR__UASYNCIO { MP_ROM_QSTR(MP_QSTR__uasyncio), MP_ROM_PTR(&mp_module_uasyncio) }, + +extern const struct _mp_obj_module_t mp_module_builtins; +#undef MODULE_DEF_MP_QSTR_BUILTINS +#define MODULE_DEF_MP_QSTR_BUILTINS { MP_ROM_QSTR(MP_QSTR_builtins), MP_ROM_PTR(&mp_module_builtins) }, + +extern const struct _mp_obj_module_t mp_module_cmath; +#undef MODULE_DEF_MP_QSTR_CMATH +#define MODULE_DEF_MP_QSTR_CMATH { MP_ROM_QSTR(MP_QSTR_cmath), MP_ROM_PTR(&mp_module_cmath) }, + +extern const struct _mp_obj_module_t mp_module_framebuf; +#undef MODULE_DEF_MP_QSTR_FRAMEBUF +#define MODULE_DEF_MP_QSTR_FRAMEBUF { MP_ROM_QSTR(MP_QSTR_framebuf), MP_ROM_PTR(&mp_module_framebuf) }, + +extern const struct _mp_obj_module_t mp_module_gc; +#undef MODULE_DEF_MP_QSTR_GC +#define MODULE_DEF_MP_QSTR_GC { MP_ROM_QSTR(MP_QSTR_gc), MP_ROM_PTR(&mp_module_gc) }, + +extern const struct _mp_obj_module_t mp_module_math; +#undef MODULE_DEF_MP_QSTR_MATH +#define MODULE_DEF_MP_QSTR_MATH { MP_ROM_QSTR(MP_QSTR_math), MP_ROM_PTR(&mp_module_math) }, + +extern const struct _mp_obj_module_t mp_module_micropython; +#undef MODULE_DEF_MP_QSTR_MICROPYTHON +#define MODULE_DEF_MP_QSTR_MICROPYTHON { MP_ROM_QSTR(MP_QSTR_micropython), MP_ROM_PTR(&mp_module_micropython) }, + +extern const struct _mp_obj_module_t mp_module_network; +#undef MODULE_DEF_MP_QSTR_NETWORK +#define MODULE_DEF_MP_QSTR_NETWORK { MP_ROM_QSTR(MP_QSTR_network), MP_ROM_PTR(&mp_module_network) }, + +extern const struct _mp_obj_module_t mp_module_uarray; +#undef MODULE_DEF_MP_QSTR_UARRAY +#define MODULE_DEF_MP_QSTR_UARRAY { MP_ROM_QSTR(MP_QSTR_uarray), MP_ROM_PTR(&mp_module_uarray) }, + +extern const struct _mp_obj_module_t mp_module_ubinascii; +#undef MODULE_DEF_MP_QSTR_UBINASCII +#define MODULE_DEF_MP_QSTR_UBINASCII { MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) }, + +extern const struct _mp_obj_module_t mp_module_collections; +#undef MODULE_DEF_MP_QSTR_UCOLLECTIONS +#define MODULE_DEF_MP_QSTR_UCOLLECTIONS { MP_ROM_QSTR(MP_QSTR_ucollections), MP_ROM_PTR(&mp_module_collections) }, + +extern const struct _mp_obj_module_t mp_module_uctypes; +#undef MODULE_DEF_MP_QSTR_UCTYPES +#define MODULE_DEF_MP_QSTR_UCTYPES { MP_ROM_QSTR(MP_QSTR_uctypes), MP_ROM_PTR(&mp_module_uctypes) }, + +extern const struct _mp_obj_module_t mp_module_uerrno; +#undef MODULE_DEF_MP_QSTR_UERRNO +#define MODULE_DEF_MP_QSTR_UERRNO { MP_ROM_QSTR(MP_QSTR_uerrno), MP_ROM_PTR(&mp_module_uerrno) }, + +extern const struct _mp_obj_module_t mp_module_uhashlib; +#undef MODULE_DEF_MP_QSTR_UHASHLIB +#define MODULE_DEF_MP_QSTR_UHASHLIB { MP_ROM_QSTR(MP_QSTR_uhashlib), MP_ROM_PTR(&mp_module_uhashlib) }, + +extern const struct _mp_obj_module_t mp_module_uheapq; +#undef MODULE_DEF_MP_QSTR_UHEAPQ +#define MODULE_DEF_MP_QSTR_UHEAPQ { MP_ROM_QSTR(MP_QSTR_uheapq), MP_ROM_PTR(&mp_module_uheapq) }, + +extern const struct _mp_obj_module_t mp_module_io; +#undef MODULE_DEF_MP_QSTR_UIO +#define MODULE_DEF_MP_QSTR_UIO { MP_ROM_QSTR(MP_QSTR_uio), MP_ROM_PTR(&mp_module_io) }, + +extern const struct _mp_obj_module_t mp_module_ujson; +#undef MODULE_DEF_MP_QSTR_UJSON +#define MODULE_DEF_MP_QSTR_UJSON { MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) }, + +extern const struct _mp_obj_module_t mp_module_machine; +#undef MODULE_DEF_MP_QSTR_UMACHINE +#define MODULE_DEF_MP_QSTR_UMACHINE { MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, + +extern const struct _mp_obj_module_t mp_module_uos; +#undef MODULE_DEF_MP_QSTR_UOS +#define MODULE_DEF_MP_QSTR_UOS { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos) }, + +extern const struct _mp_obj_module_t mp_module_urandom; +#undef MODULE_DEF_MP_QSTR_URANDOM +#define MODULE_DEF_MP_QSTR_URANDOM { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) }, + +extern const struct _mp_obj_module_t mp_module_ure; +#undef MODULE_DEF_MP_QSTR_URE +#define MODULE_DEF_MP_QSTR_URE { MP_ROM_QSTR(MP_QSTR_ure), MP_ROM_PTR(&mp_module_ure) }, + +extern const struct _mp_obj_module_t mp_module_uselect; +#undef MODULE_DEF_MP_QSTR_USELECT +#define MODULE_DEF_MP_QSTR_USELECT { MP_ROM_QSTR(MP_QSTR_uselect), MP_ROM_PTR(&mp_module_uselect) }, + +extern const struct _mp_obj_module_t mp_module_usocket; +#undef MODULE_DEF_MP_QSTR_USOCKET +#define MODULE_DEF_MP_QSTR_USOCKET { MP_ROM_QSTR(MP_QSTR_usocket), MP_ROM_PTR(&mp_module_usocket) }, + +extern const struct _mp_obj_module_t mp_module_ustruct; +#undef MODULE_DEF_MP_QSTR_USTRUCT +#define MODULE_DEF_MP_QSTR_USTRUCT { MP_ROM_QSTR(MP_QSTR_ustruct), MP_ROM_PTR(&mp_module_ustruct) }, + +extern const struct _mp_obj_module_t mp_module_sys; +#undef MODULE_DEF_MP_QSTR_USYS +#define MODULE_DEF_MP_QSTR_USYS { MP_ROM_QSTR(MP_QSTR_usys), MP_ROM_PTR(&mp_module_sys) }, + +extern const struct _mp_obj_module_t mp_module_utime; +#undef MODULE_DEF_MP_QSTR_UTIME +#define MODULE_DEF_MP_QSTR_UTIME { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_utime) }, + +extern const struct _mp_obj_module_t mp_module_uzlib; +#undef MODULE_DEF_MP_QSTR_UZLIB +#define MODULE_DEF_MP_QSTR_UZLIB { MP_ROM_QSTR(MP_QSTR_uzlib), MP_ROM_PTR(&mp_module_uzlib) }, + + +#define MICROPY_REGISTERED_MODULES \ + MODULE_DEF_MP_QSTR_BUILTINS \ + MODULE_DEF_MP_QSTR_CMATH \ + MODULE_DEF_MP_QSTR_FRAMEBUF \ + MODULE_DEF_MP_QSTR_GC \ + MODULE_DEF_MP_QSTR_MATH \ + MODULE_DEF_MP_QSTR_MICROPYTHON \ + MODULE_DEF_MP_QSTR_NETWORK \ + MODULE_DEF_MP_QSTR_UARRAY \ + MODULE_DEF_MP_QSTR_UBINASCII \ + MODULE_DEF_MP_QSTR_UCOLLECTIONS \ + MODULE_DEF_MP_QSTR_UCTYPES \ + MODULE_DEF_MP_QSTR_UERRNO \ + MODULE_DEF_MP_QSTR_UHASHLIB \ + MODULE_DEF_MP_QSTR_UHEAPQ \ + MODULE_DEF_MP_QSTR_UIO \ + MODULE_DEF_MP_QSTR_UJSON \ + MODULE_DEF_MP_QSTR_UMACHINE \ + MODULE_DEF_MP_QSTR_UOS \ + MODULE_DEF_MP_QSTR_URANDOM \ + MODULE_DEF_MP_QSTR_URE \ + MODULE_DEF_MP_QSTR_USELECT \ + MODULE_DEF_MP_QSTR_USOCKET \ + MODULE_DEF_MP_QSTR_USTRUCT \ + MODULE_DEF_MP_QSTR_USYS \ + MODULE_DEF_MP_QSTR_UTIME \ + MODULE_DEF_MP_QSTR_UZLIB \ + MODULE_DEF_MP_QSTR__THREAD \ + MODULE_DEF_MP_QSTR__UASYNCIO \ + MODULE_DEF_MP_QSTR___MAIN__ \ +// MICROPY_REGISTERED_MODULES diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/mpversion.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/mpversion.h new file mode 100644 index 00000000..28b57595 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/mpversion.h @@ -0,0 +1,4 @@ +// This file was generated by py/makeversionhdr.py +#define MICROPY_GIT_TAG "v2.5.0-73-g0e22ad73-dirty" +#define MICROPY_GIT_HASH "0e22ad73-dirty" +#define MICROPY_BUILD_DATE "2022-09-25" diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/qstrdefs.generated.h b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/qstrdefs.generated.h new file mode 100644 index 00000000..e6bc9971 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/genhdr/qstrdefs.generated.h @@ -0,0 +1,752 @@ +// This file was automatically generated by makeqstrdata.py + +QDEF(MP_QSTRnull, 0, 0, "") +QDEF(MP_QSTR_, 5381, 0, "") +QDEF(MP_QSTR___dir__, 36730, 7, "__dir__") +QDEF(MP_QSTR__0x0a_, 46511, 1, "\x0a") +QDEF(MP_QSTR__space_, 46469, 1, " ") +QDEF(MP_QSTR__star_, 46479, 1, "*") +QDEF(MP_QSTR__slash_, 46474, 1, "/") +QDEF(MP_QSTR__lt_module_gt_, 38077, 8, "") +QDEF(MP_QSTR__, 46586, 1, "_") +QDEF(MP_QSTR___call__, 63911, 8, "__call__") +QDEF(MP_QSTR___class__, 50475, 9, "__class__") +QDEF(MP_QSTR___delitem__, 13821, 11, "__delitem__") +QDEF(MP_QSTR___enter__, 47725, 9, "__enter__") +QDEF(MP_QSTR___exit__, 63557, 8, "__exit__") +QDEF(MP_QSTR___getattr__, 63552, 11, "__getattr__") +QDEF(MP_QSTR___getitem__, 14630, 11, "__getitem__") +QDEF(MP_QSTR___hash__, 51447, 8, "__hash__") +QDEF(MP_QSTR___init__, 42335, 8, "__init__") +QDEF(MP_QSTR___int__, 6934, 7, "__int__") +QDEF(MP_QSTR___iter__, 13007, 8, "__iter__") +QDEF(MP_QSTR___len__, 45282, 7, "__len__") +QDEF(MP_QSTR___main__, 5006, 8, "__main__") +QDEF(MP_QSTR___module__, 12543, 10, "__module__") +QDEF(MP_QSTR___name__, 14562, 8, "__name__") +QDEF(MP_QSTR___new__, 5497, 7, "__new__") +QDEF(MP_QSTR___next__, 29442, 8, "__next__") +QDEF(MP_QSTR___qualname__, 107, 12, "__qualname__") +QDEF(MP_QSTR___repr__, 2832, 8, "__repr__") +QDEF(MP_QSTR___setitem__, 15922, 11, "__setitem__") +QDEF(MP_QSTR___str__, 52688, 7, "__str__") +QDEF(MP_QSTR_ArithmeticError, 35885, 15, "ArithmeticError") +QDEF(MP_QSTR_AssertionError, 23191, 14, "AssertionError") +QDEF(MP_QSTR_AttributeError, 56865, 14, "AttributeError") +QDEF(MP_QSTR_BaseException, 37383, 13, "BaseException") +QDEF(MP_QSTR_EOFError, 49041, 8, "EOFError") +QDEF(MP_QSTR_Ellipsis, 57584, 8, "Ellipsis") +QDEF(MP_QSTR_Exception, 10738, 9, "Exception") +QDEF(MP_QSTR_GeneratorExit, 25110, 13, "GeneratorExit") +QDEF(MP_QSTR_ImportError, 39968, 11, "ImportError") +QDEF(MP_QSTR_IndentationError, 8284, 16, "IndentationError") +QDEF(MP_QSTR_IndexError, 44419, 10, "IndexError") +QDEF(MP_QSTR_KeyError, 234, 8, "KeyError") +QDEF(MP_QSTR_KeyboardInterrupt, 58031, 17, "KeyboardInterrupt") +QDEF(MP_QSTR_LookupError, 27135, 11, "LookupError") +QDEF(MP_QSTR_MemoryError, 33756, 11, "MemoryError") +QDEF(MP_QSTR_NameError, 11706, 9, "NameError") +QDEF(MP_QSTR_NoneType, 26647, 8, "NoneType") +QDEF(MP_QSTR_NotImplementedError, 39110, 19, "NotImplementedError") +QDEF(MP_QSTR_OSError, 26017, 7, "OSError") +QDEF(MP_QSTR_OverflowError, 57729, 13, "OverflowError") +QDEF(MP_QSTR_RuntimeError, 61793, 12, "RuntimeError") +QDEF(MP_QSTR_StopIteration, 7402, 13, "StopIteration") +QDEF(MP_QSTR_SyntaxError, 36756, 11, "SyntaxError") +QDEF(MP_QSTR_SystemExit, 65312, 10, "SystemExit") +QDEF(MP_QSTR_TypeError, 38437, 9, "TypeError") +QDEF(MP_QSTR_ValueError, 34710, 10, "ValueError") +QDEF(MP_QSTR_ZeroDivisionError, 10166, 17, "ZeroDivisionError") +QDEF(MP_QSTR_abs, 12949, 3, "abs") +QDEF(MP_QSTR_all, 13124, 3, "all") +QDEF(MP_QSTR_any, 13075, 3, "any") +QDEF(MP_QSTR_append, 38763, 6, "append") +QDEF(MP_QSTR_args, 50882, 4, "args") +QDEF(MP_QSTR_bool, 15595, 4, "bool") +QDEF(MP_QSTR_builtins, 12791, 8, "builtins") +QDEF(MP_QSTR_bytearray, 41846, 9, "bytearray") +QDEF(MP_QSTR_bytecode, 32034, 8, "bytecode") +QDEF(MP_QSTR_bytes, 45660, 5, "bytes") +QDEF(MP_QSTR_callable, 28685, 8, "callable") +QDEF(MP_QSTR_chr, 19676, 3, "chr") +QDEF(MP_QSTR_classmethod, 36020, 11, "classmethod") +QDEF(MP_QSTR_clear, 41084, 5, "clear") +QDEF(MP_QSTR_close, 26419, 5, "close") +QDEF(MP_QSTR_const, 65472, 5, "const") +QDEF(MP_QSTR_copy, 56288, 4, "copy") +QDEF(MP_QSTR_count, 19878, 5, "count") +QDEF(MP_QSTR_dict, 64575, 4, "dict") +QDEF(MP_QSTR_dir, 7930, 3, "dir") +QDEF(MP_QSTR_divmod, 1208, 6, "divmod") +QDEF(MP_QSTR_end, 8970, 3, "end") +QDEF(MP_QSTR_endswith, 41755, 8, "endswith") +QDEF(MP_QSTR_eval, 42651, 4, "eval") +QDEF(MP_QSTR_exec, 49182, 4, "exec") +QDEF(MP_QSTR_extend, 59491, 6, "extend") +QDEF(MP_QSTR_find, 13312, 4, "find") +QDEF(MP_QSTR_format, 13094, 6, "format") +QDEF(MP_QSTR_from_bytes, 29749, 10, "from_bytes") +QDEF(MP_QSTR_get, 15155, 3, "get") +QDEF(MP_QSTR_getattr, 6080, 7, "getattr") +QDEF(MP_QSTR_globals, 18845, 7, "globals") +QDEF(MP_QSTR_hasattr, 45196, 7, "hasattr") +QDEF(MP_QSTR_hash, 28855, 4, "hash") +QDEF(MP_QSTR_id, 28456, 2, "id") +QDEF(MP_QSTR_index, 10363, 5, "index") +QDEF(MP_QSTR_insert, 21522, 6, "insert") +QDEF(MP_QSTR_int, 21270, 3, "int") +QDEF(MP_QSTR_isalpha, 14315, 7, "isalpha") +QDEF(MP_QSTR_isdigit, 39592, 7, "isdigit") +QDEF(MP_QSTR_isinstance, 48822, 10, "isinstance") +QDEF(MP_QSTR_islower, 33020, 7, "islower") +QDEF(MP_QSTR_isspace, 63579, 7, "isspace") +QDEF(MP_QSTR_issubclass, 32693, 10, "issubclass") +QDEF(MP_QSTR_isupper, 42973, 7, "isupper") +QDEF(MP_QSTR_items, 21475, 5, "items") +QDEF(MP_QSTR_iter, 8591, 4, "iter") +QDEF(MP_QSTR_join, 23719, 4, "join") +QDEF(MP_QSTR_key, 27954, 3, "key") +QDEF(MP_QSTR_keys, 4865, 4, "keys") +QDEF(MP_QSTR_len, 16482, 3, "len") +QDEF(MP_QSTR_list, 7463, 4, "list") +QDEF(MP_QSTR_little, 27273, 6, "little") +QDEF(MP_QSTR_locals, 41275, 6, "locals") +QDEF(MP_QSTR_lower, 52166, 5, "lower") +QDEF(MP_QSTR_lstrip, 47589, 6, "lstrip") +QDEF(MP_QSTR_main, 47054, 4, "main") +QDEF(MP_QSTR_map, 17337, 3, "map") +QDEF(MP_QSTR_micropython, 31755, 11, "micropython") +QDEF(MP_QSTR_next, 34882, 4, "next") +QDEF(MP_QSTR_object, 36240, 6, "object") +QDEF(MP_QSTR_open, 15057, 4, "open") +QDEF(MP_QSTR_ord, 24092, 3, "ord") +QDEF(MP_QSTR_pop, 29482, 3, "pop") +QDEF(MP_QSTR_popitem, 11455, 7, "popitem") +QDEF(MP_QSTR_pow, 29485, 3, "pow") +QDEF(MP_QSTR_print, 50772, 5, "print") +QDEF(MP_QSTR_range, 24090, 5, "range") +QDEF(MP_QSTR_read, 63927, 4, "read") +QDEF(MP_QSTR_readinto, 48971, 8, "readinto") +QDEF(MP_QSTR_readline, 6649, 8, "readline") +QDEF(MP_QSTR_remove, 35427, 6, "remove") +QDEF(MP_QSTR_replace, 9545, 7, "replace") +QDEF(MP_QSTR_repr, 63440, 4, "repr") +QDEF(MP_QSTR_reverse, 10789, 7, "reverse") +QDEF(MP_QSTR_rfind, 40146, 5, "rfind") +QDEF(MP_QSTR_rindex, 11241, 6, "rindex") +QDEF(MP_QSTR_round, 9703, 5, "round") +QDEF(MP_QSTR_rsplit, 165, 6, "rsplit") +QDEF(MP_QSTR_rstrip, 38203, 6, "rstrip") +QDEF(MP_QSTR_self, 30585, 4, "self") +QDEF(MP_QSTR_send, 30393, 4, "send") +QDEF(MP_QSTR_sep, 36643, 3, "sep") +QDEF(MP_QSTR_set, 36647, 3, "set") +QDEF(MP_QSTR_setattr, 43220, 7, "setattr") +QDEF(MP_QSTR_setdefault, 41836, 10, "setdefault") +QDEF(MP_QSTR_sort, 40383, 4, "sort") +QDEF(MP_QSTR_sorted, 5470, 6, "sorted") +QDEF(MP_QSTR_split, 13239, 5, "split") +QDEF(MP_QSTR_start, 61317, 5, "start") +QDEF(MP_QSTR_startswith, 59508, 10, "startswith") +QDEF(MP_QSTR_staticmethod, 44898, 12, "staticmethod") +QDEF(MP_QSTR_step, 13911, 4, "step") +QDEF(MP_QSTR_stop, 13981, 4, "stop") +QDEF(MP_QSTR_str, 36176, 3, "str") +QDEF(MP_QSTR_strip, 7721, 5, "strip") +QDEF(MP_QSTR_sum, 36142, 3, "sum") +QDEF(MP_QSTR_super, 45764, 5, "super") +QDEF(MP_QSTR_throw, 17587, 5, "throw") +QDEF(MP_QSTR_to_bytes, 16088, 8, "to_bytes") +QDEF(MP_QSTR_tuple, 16893, 5, "tuple") +QDEF(MP_QSTR_type, 32669, 4, "type") +QDEF(MP_QSTR_update, 30388, 6, "update") +QDEF(MP_QSTR_upper, 37927, 5, "upper") +QDEF(MP_QSTR_utf_hyphen_8, 33463, 5, "utf-8") +QDEF(MP_QSTR_value, 13390, 5, "value") +QDEF(MP_QSTR_values, 48765, 6, "values") +QDEF(MP_QSTR_write, 43160, 5, "write") +QDEF(MP_QSTR_zip, 44262, 3, "zip") +QDEF(MP_QSTR___abs__, 54933, 7, "__abs__") +QDEF(MP_QSTR___add__, 33476, 7, "__add__") +QDEF(MP_QSTR___aenter__, 33868, 10, "__aenter__") +QDEF(MP_QSTR___aexit__, 53188, 9, "__aexit__") +QDEF(MP_QSTR___aiter__, 11086, 9, "__aiter__") +QDEF(MP_QSTR___and__, 56078, 7, "__and__") +QDEF(MP_QSTR___anext__, 46211, 9, "__anext__") +QDEF(MP_QSTR___bases__, 12291, 9, "__bases__") +QDEF(MP_QSTR___bool__, 25899, 8, "__bool__") +QDEF(MP_QSTR___build_class__, 34882, 15, "__build_class__") +QDEF(MP_QSTR___contains__, 24518, 12, "__contains__") +QDEF(MP_QSTR___del__, 14184, 7, "__del__") +QDEF(MP_QSTR___delattr__, 30555, 11, "__delattr__") +QDEF(MP_QSTR___delete__, 60892, 10, "__delete__") +QDEF(MP_QSTR___dict__, 21631, 8, "__dict__") +QDEF(MP_QSTR___divmod__, 4472, 10, "__divmod__") +QDEF(MP_QSTR___eq__, 15985, 6, "__eq__") +QDEF(MP_QSTR___file__, 21507, 8, "__file__") +QDEF(MP_QSTR___floordiv__, 24390, 12, "__floordiv__") +QDEF(MP_QSTR___ge__, 18087, 6, "__ge__") +QDEF(MP_QSTR___get__, 36787, 7, "__get__") +QDEF(MP_QSTR___globals__, 44701, 11, "__globals__") +QDEF(MP_QSTR___gt__, 33462, 6, "__gt__") +QDEF(MP_QSTR___iadd__, 19053, 8, "__iadd__") +QDEF(MP_QSTR___iand__, 8615, 8, "__iand__") +QDEF(MP_QSTR___ifloordiv__, 3919, 13, "__ifloordiv__") +QDEF(MP_QSTR___ilshift__, 41600, 11, "__ilshift__") +QDEF(MP_QSTR___imatmul__, 28352, 11, "__imatmul__") +QDEF(MP_QSTR___imod__, 34378, 8, "__imod__") +QDEF(MP_QSTR___import__, 15928, 10, "__import__") +QDEF(MP_QSTR___imul__, 52760, 8, "__imul__") +QDEF(MP_QSTR___invert__, 30711, 10, "__invert__") +QDEF(MP_QSTR___ior__, 36849, 7, "__ior__") +QDEF(MP_QSTR___ipow__, 54660, 8, "__ipow__") +QDEF(MP_QSTR___irshift__, 63710, 11, "__irshift__") +QDEF(MP_QSTR___isub__, 30728, 8, "__isub__") +QDEF(MP_QSTR___itruediv__, 545, 12, "__itruediv__") +QDEF(MP_QSTR___ixor__, 47369, 8, "__ixor__") +QDEF(MP_QSTR___le__, 5068, 6, "__le__") +QDEF(MP_QSTR___lshift__, 34825, 10, "__lshift__") +QDEF(MP_QSTR___lt__, 26717, 6, "__lt__") +QDEF(MP_QSTR___matmul__, 62281, 10, "__matmul__") +QDEF(MP_QSTR___mod__, 14179, 7, "__mod__") +QDEF(MP_QSTR___mul__, 16945, 7, "__mul__") +QDEF(MP_QSTR___ne__, 2830, 6, "__ne__") +QDEF(MP_QSTR___neg__, 54633, 7, "__neg__") +QDEF(MP_QSTR___or__, 47928, 6, "__or__") +QDEF(MP_QSTR___path__, 9160, 8, "__path__") +QDEF(MP_QSTR___pos__, 61481, 7, "__pos__") +QDEF(MP_QSTR___pow__, 45, 7, "__pow__") +QDEF(MP_QSTR___radd__, 50454, 8, "__radd__") +QDEF(MP_QSTR___rand__, 11996, 8, "__rand__") +QDEF(MP_QSTR___repl_print__, 47872, 14, "__repl_print__") +QDEF(MP_QSTR___reversed__, 65377, 12, "__reversed__") +QDEF(MP_QSTR___rfloordiv__, 38996, 13, "__rfloordiv__") +QDEF(MP_QSTR___rlshift__, 53531, 11, "__rlshift__") +QDEF(MP_QSTR___rmatmul__, 987, 11, "__rmatmul__") +QDEF(MP_QSTR___rmod__, 35377, 8, "__rmod__") +QDEF(MP_QSTR___rmul__, 355, 8, "__rmul__") +QDEF(MP_QSTR___ror__, 56362, 7, "__ror__") +QDEF(MP_QSTR___rpow__, 39679, 8, "__rpow__") +QDEF(MP_QSTR___rrshift__, 40389, 11, "__rrshift__") +QDEF(MP_QSTR___rshift__, 38999, 10, "__rshift__") +QDEF(MP_QSTR___rsub__, 30579, 8, "__rsub__") +QDEF(MP_QSTR___rtruediv__, 55130, 12, "__rtruediv__") +QDEF(MP_QSTR___rxor__, 34546, 8, "__rxor__") +QDEF(MP_QSTR___set__, 45991, 7, "__set__") +QDEF(MP_QSTR___setattr__, 6484, 11, "__setattr__") +QDEF(MP_QSTR___sub__, 2337, 7, "__sub__") +QDEF(MP_QSTR___traceback__, 53071, 13, "__traceback__") +QDEF(MP_QSTR___truediv__, 61320, 11, "__truediv__") +QDEF(MP_QSTR___xor__, 60448, 7, "__xor__") +QDEF(MP_QSTR__gt__gt__gt__space_, 44187, 4, ">>> ") +QDEF(MP_QSTR__dot__dot__dot__space_, 10379, 4, "... ") +QDEF(MP_QSTR__percent__hash_o, 6764, 3, "%#o") +QDEF(MP_QSTR__percent__hash_x, 6779, 3, "%#x") +QDEF(MP_QSTR__brace_open__colon__hash_b_brace_close_, 14168, 5, "{:#b}") +QDEF(MP_QSTR_maximum_space_recursion_space_depth_space_exceeded, 7795, 32, "maximum recursion depth exceeded") +QDEF(MP_QSTR__lt_lambda_gt_, 35968, 8, "") +QDEF(MP_QSTR__lt_listcomp_gt_, 5588, 10, "") +QDEF(MP_QSTR__lt_dictcomp_gt_, 36300, 10, "") +QDEF(MP_QSTR__lt_setcomp_gt_, 20820, 9, "") +QDEF(MP_QSTR__lt_genexpr_gt_, 27188, 9, "") +QDEF(MP_QSTR__lt_string_gt_, 21330, 8, "") +QDEF(MP_QSTR__lt_stdin_gt_, 25571, 7, "") +QDEF(MP_QSTR_A0, 29268, 2, "A0") +QDEF(MP_QSTR_A1, 29269, 2, "A1") +QDEF(MP_QSTR_A10, 48325, 3, "A10") +QDEF(MP_QSTR_A11, 48324, 3, "A11") +QDEF(MP_QSTR_A12, 48327, 3, "A12") +QDEF(MP_QSTR_A13, 48326, 3, "A13") +QDEF(MP_QSTR_A14, 48321, 3, "A14") +QDEF(MP_QSTR_A15, 48320, 3, "A15") +QDEF(MP_QSTR_A2, 29270, 2, "A2") +QDEF(MP_QSTR_A3, 29271, 2, "A3") +QDEF(MP_QSTR_A4, 29264, 2, "A4") +QDEF(MP_QSTR_A5, 29265, 2, "A5") +QDEF(MP_QSTR_A6, 29266, 2, "A6") +QDEF(MP_QSTR_A7, 29267, 2, "A7") +QDEF(MP_QSTR_A8, 29276, 2, "A8") +QDEF(MP_QSTR_A9, 29277, 2, "A9") +QDEF(MP_QSTR_AF_INET, 47083, 7, "AF_INET") +QDEF(MP_QSTR_AF_INET6, 46461, 8, "AF_INET6") +QDEF(MP_QSTR_AP_IF, 38404, 5, "AP_IF") +QDEF(MP_QSTR_ARRAY, 31324, 5, "ARRAY") +QDEF(MP_QSTR_B0, 29431, 2, "B0") +QDEF(MP_QSTR_B1, 29430, 2, "B1") +QDEF(MP_QSTR_B10, 53638, 3, "B10") +QDEF(MP_QSTR_B11, 53639, 3, "B11") +QDEF(MP_QSTR_B12, 53636, 3, "B12") +QDEF(MP_QSTR_B13, 53637, 3, "B13") +QDEF(MP_QSTR_B14, 53634, 3, "B14") +QDEF(MP_QSTR_B15, 53635, 3, "B15") +QDEF(MP_QSTR_B2, 29429, 2, "B2") +QDEF(MP_QSTR_B3, 29428, 2, "B3") +QDEF(MP_QSTR_B4, 29427, 2, "B4") +QDEF(MP_QSTR_B5, 29426, 2, "B5") +QDEF(MP_QSTR_B6, 29425, 2, "B6") +QDEF(MP_QSTR_B7, 29424, 2, "B7") +QDEF(MP_QSTR_B8, 29439, 2, "B8") +QDEF(MP_QSTR_B9, 29438, 2, "B9") +QDEF(MP_QSTR_BFINT16, 58005, 7, "BFINT16") +QDEF(MP_QSTR_BFINT32, 57939, 7, "BFINT32") +QDEF(MP_QSTR_BFINT8, 39498, 6, "BFINT8") +QDEF(MP_QSTR_BFUINT16, 42560, 8, "BFUINT16") +QDEF(MP_QSTR_BFUINT32, 42502, 8, "BFUINT32") +QDEF(MP_QSTR_BFUINT8, 44991, 7, "BFUINT8") +QDEF(MP_QSTR_BF_LEN, 45081, 6, "BF_LEN") +QDEF(MP_QSTR_BF_POS, 40274, 6, "BF_POS") +QDEF(MP_QSTR_BIG_ENDIAN, 20991, 10, "BIG_ENDIAN") +QDEF(MP_QSTR_BytesIO, 46874, 7, "BytesIO") +QDEF(MP_QSTR_C0, 29334, 2, "C0") +QDEF(MP_QSTR_C1, 29335, 2, "C1") +QDEF(MP_QSTR_C10, 50503, 3, "C10") +QDEF(MP_QSTR_C11, 50502, 3, "C11") +QDEF(MP_QSTR_C12, 50501, 3, "C12") +QDEF(MP_QSTR_C13, 50500, 3, "C13") +QDEF(MP_QSTR_C14, 50499, 3, "C14") +QDEF(MP_QSTR_C15, 50498, 3, "C15") +QDEF(MP_QSTR_C2, 29332, 2, "C2") +QDEF(MP_QSTR_C3, 29333, 2, "C3") +QDEF(MP_QSTR_C4, 29330, 2, "C4") +QDEF(MP_QSTR_C5, 29331, 2, "C5") +QDEF(MP_QSTR_C6, 29328, 2, "C6") +QDEF(MP_QSTR_C7, 29329, 2, "C7") +QDEF(MP_QSTR_C8, 29342, 2, "C8") +QDEF(MP_QSTR_C9, 29343, 2, "C9") +QDEF(MP_QSTR_CancelledError, 39926, 14, "CancelledError") +QDEF(MP_QSTR_D2, 29235, 2, "D2") +QDEF(MP_QSTR_DecompIO, 46995, 8, "DecompIO") +QDEF(MP_QSTR_EACCES, 49719, 6, "EACCES") +QDEF(MP_QSTR_EADDRINUSE, 4375, 10, "EADDRINUSE") +QDEF(MP_QSTR_EAGAIN, 60448, 6, "EAGAIN") +QDEF(MP_QSTR_EALREADY, 5446, 8, "EALREADY") +QDEF(MP_QSTR_EBADF, 41825, 5, "EBADF") +QDEF(MP_QSTR_ECONNABORTED, 43815, 12, "ECONNABORTED") +QDEF(MP_QSTR_ECONNREFUSED, 11322, 12, "ECONNREFUSED") +QDEF(MP_QSTR_ECONNRESET, 64281, 10, "ECONNRESET") +QDEF(MP_QSTR_EEXIST, 44371, 6, "EEXIST") +QDEF(MP_QSTR_EHOSTUNREACH, 9606, 12, "EHOSTUNREACH") +QDEF(MP_QSTR_EINPROGRESS, 41114, 11, "EINPROGRESS") +QDEF(MP_QSTR_EINVAL, 65372, 6, "EINVAL") +QDEF(MP_QSTR_EIO, 42630, 3, "EIO") +QDEF(MP_QSTR_EISDIR, 20389, 6, "EISDIR") +QDEF(MP_QSTR_ENOBUFS, 34787, 7, "ENOBUFS") +QDEF(MP_QSTR_ENODEV, 26550, 6, "ENODEV") +QDEF(MP_QSTR_ENOENT, 25950, 6, "ENOENT") +QDEF(MP_QSTR_ENOMEM, 34212, 6, "ENOMEM") +QDEF(MP_QSTR_ENOTCONN, 55161, 8, "ENOTCONN") +QDEF(MP_QSTR_EOPNOTSUPP, 38828, 10, "EOPNOTSUPP") +QDEF(MP_QSTR_EPERM, 32746, 5, "EPERM") +QDEF(MP_QSTR_ESP8266, 55433, 7, "ESP8266") +QDEF(MP_QSTR_ETIMEDOUT, 63743, 9, "ETIMEDOUT") +QDEF(MP_QSTR_FLOAT32, 34740, 7, "FLOAT32") +QDEF(MP_QSTR_FLOAT64, 34583, 7, "FLOAT64") +QDEF(MP_QSTR_FileIO, 5573, 6, "FileIO") +QDEF(MP_QSTR_FrameBuffer, 48856, 11, "FrameBuffer") +QDEF(MP_QSTR_FrameBuffer1, 39401, 12, "FrameBuffer1") +QDEF(MP_QSTR_GS2_HMSB, 49960, 8, "GS2_HMSB") +QDEF(MP_QSTR_GS4_HMSB, 29550, 8, "GS4_HMSB") +QDEF(MP_QSTR_GS8, 49321, 3, "GS8") +QDEF(MP_QSTR_IN, 29474, 2, "IN") +QDEF(MP_QSTR_INT, 55094, 3, "INT") +QDEF(MP_QSTR_INT16, 30353, 5, "INT16") +QDEF(MP_QSTR_INT32, 30295, 5, "INT32") +QDEF(MP_QSTR_INT64, 30196, 5, "INT64") +QDEF(MP_QSTR_INT8, 48590, 4, "INT8") +QDEF(MP_QSTR_IN_PULLDOWN, 47946, 11, "IN_PULLDOWN") +QDEF(MP_QSTR_IN_PULLUP, 55837, 9, "IN_PULLUP") +QDEF(MP_QSTR_IOBase, 48694, 6, "IOBase") +QDEF(MP_QSTR_IRQ_FALLING, 49207, 11, "IRQ_FALLING") +QDEF(MP_QSTR_IRQ_RISING, 60792, 10, "IRQ_RISING") +QDEF(MP_QSTR_KEY1, 4963, 4, "KEY1") +QDEF(MP_QSTR_KEY2, 4960, 4, "KEY2") +QDEF(MP_QSTR_LED, 56456, 3, "LED") +QDEF(MP_QSTR_LITTLE_ENDIAN, 23487, 13, "LITTLE_ENDIAN") +QDEF(MP_QSTR_LONG, 25871, 4, "LONG") +QDEF(MP_QSTR_LONGLONG, 54405, 8, "LONGLONG") +QDEF(MP_QSTR_LSB, 57048, 3, "LSB") +QDEF(MP_QSTR_LockType, 8246, 8, "LockType") +QDEF(MP_QSTR_MONO_HLSB, 38988, 9, "MONO_HLSB") +QDEF(MP_QSTR_MONO_HMSB, 33741, 9, "MONO_HMSB") +QDEF(MP_QSTR_MONO_VLSB, 64530, 9, "MONO_VLSB") +QDEF(MP_QSTR_MSB, 51801, 3, "MSB") +QDEF(MP_QSTR_MVLSB, 5123, 5, "MVLSB") +QDEF(MP_QSTR_NATIVE, 36356, 6, "NATIVE") +QDEF(MP_QSTR_NotImplemented, 50750, 14, "NotImplemented") +QDEF(MP_QSTR_ONE_SHOT, 65374, 8, "ONE_SHOT") +QDEF(MP_QSTR_OPEN_DRAIN, 18526, 10, "OPEN_DRAIN") +QDEF(MP_QSTR_OUT, 58123, 3, "OUT") +QDEF(MP_QSTR_OrderedDict, 32496, 11, "OrderedDict") +QDEF(MP_QSTR_PERIODIC, 13578, 8, "PERIODIC") +QDEF(MP_QSTR_POLLERR, 49375, 7, "POLLERR") +QDEF(MP_QSTR_POLLHUP, 35447, 7, "POLLHUP") +QDEF(MP_QSTR_POLLIN, 24957, 6, "POLLIN") +QDEF(MP_QSTR_POLLOUT, 34164, 7, "POLLOUT") +QDEF(MP_QSTR_PTR, 3251, 3, "PTR") +QDEF(MP_QSTR_Pin, 5138, 3, "Pin") +QDEF(MP_QSTR_PinBase, 17223, 7, "PinBase") +QDEF(MP_QSTR_RGB565, 52324, 6, "RGB565") +QDEF(MP_QSTR_SHORT, 7159, 5, "SHORT") +QDEF(MP_QSTR_SOCK_DGRAM, 5299, 10, "SOCK_DGRAM") +QDEF(MP_QSTR_SOCK_RAW, 38602, 8, "SOCK_RAW") +QDEF(MP_QSTR_SOCK_STREAM, 48690, 11, "SOCK_STREAM") +QDEF(MP_QSTR_SOL_SOCKET, 57103, 10, "SOL_SOCKET") +QDEF(MP_QSTR_SO_KEEPALIVE, 41770, 12, "SO_KEEPALIVE") +QDEF(MP_QSTR_SO_RCVTIMEO, 10459, 11, "SO_RCVTIMEO") +QDEF(MP_QSTR_SO_REUSEADDR, 21281, 12, "SO_REUSEADDR") +QDEF(MP_QSTR_SO_SNDTIMEO, 65317, 11, "SO_SNDTIMEO") +QDEF(MP_QSTR_SPI, 4591, 3, "SPI") +QDEF(MP_QSTR_STA_IF, 7091, 6, "STA_IF") +QDEF(MP_QSTR_Signal, 58523, 6, "Signal") +QDEF(MP_QSTR_SoftI2C, 61971, 7, "SoftI2C") +QDEF(MP_QSTR_SoftSPI, 22561, 7, "SoftSPI") +QDEF(MP_QSTR_StopAsyncIteration, 61676, 18, "StopAsyncIteration") +QDEF(MP_QSTR_StringIO, 30326, 8, "StringIO") +QDEF(MP_QSTR_Task, 16904, 4, "Task") +QDEF(MP_QSTR_TaskQueue, 23705, 9, "TaskQueue") +QDEF(MP_QSTR_TextIOWrapper, 36269, 13, "TextIOWrapper") +QDEF(MP_QSTR_Timer, 8098, 5, "Timer") +QDEF(MP_QSTR_UART, 6583, 4, "UART") +QDEF(MP_QSTR_UINT, 15651, 4, "UINT") +QDEF(MP_QSTR_UINT16, 6084, 6, "UINT16") +QDEF(MP_QSTR_UINT32, 6018, 6, "UINT32") +QDEF(MP_QSTR_UINT64, 6241, 6, "UINT64") +QDEF(MP_QSTR_UINT8, 57787, 5, "UINT8") +QDEF(MP_QSTR_ULONG, 36218, 5, "ULONG") +QDEF(MP_QSTR_ULONGLONG, 50800, 9, "ULONGLONG") +QDEF(MP_QSTR_USHORT, 62626, 6, "USHORT") +QDEF(MP_QSTR_UnicodeError, 53538, 12, "UnicodeError") +QDEF(MP_QSTR_VOID, 62001, 4, "VOID") +QDEF(MP_QSTR_VfsTos, 55502, 6, "VfsTos") +QDEF(MP_QSTR__machine, 19391, 8, "_machine") +QDEF(MP_QSTR__task_queue, 50649, 11, "_task_queue") +QDEF(MP_QSTR__thread, 724, 7, "_thread") +QDEF(MP_QSTR__uasyncio, 24527, 9, "_uasyncio") +QDEF(MP_QSTR_a2b_base64, 2876, 10, "a2b_base64") +QDEF(MP_QSTR_abs_tol, 28029, 7, "abs_tol") +QDEF(MP_QSTR_accept, 35205, 6, "accept") +QDEF(MP_QSTR_acos, 40987, 4, "acos") +QDEF(MP_QSTR_acquire, 54045, 7, "acquire") +QDEF(MP_QSTR_add, 12868, 3, "add") +QDEF(MP_QSTR_addr, 31414, 4, "addr") +QDEF(MP_QSTR_addressof, 63834, 9, "addressof") +QDEF(MP_QSTR_addrsize, 37267, 8, "addrsize") +QDEF(MP_QSTR_alloc_emergency_exception_buf, 10872, 29, "alloc_emergency_exception_buf") +QDEF(MP_QSTR_allocate_lock, 60908, 13, "allocate_lock") +QDEF(MP_QSTR_arg, 13457, 3, "arg") +QDEF(MP_QSTR_argv, 50887, 4, "argv") +QDEF(MP_QSTR_array, 29308, 5, "array") +QDEF(MP_QSTR_asin, 58704, 4, "asin") +QDEF(MP_QSTR_atan, 48671, 4, "atan") +QDEF(MP_QSTR_atan2, 33229, 5, "atan2") +QDEF(MP_QSTR_b2a_base64, 36668, 10, "b2a_base64") +QDEF(MP_QSTR_baudrate, 55541, 8, "baudrate") +QDEF(MP_QSTR_bin, 18656, 3, "bin") +QDEF(MP_QSTR_bind, 25732, 4, "bind") +QDEF(MP_QSTR_bits, 26697, 4, "bits") +QDEF(MP_QSTR_blit, 20726, 4, "blit") +QDEF(MP_QSTR_bound_method, 41623, 12, "bound_method") +QDEF(MP_QSTR_buffer, 41189, 6, "buffer") +QDEF(MP_QSTR_buffering, 56101, 9, "buffering") +QDEF(MP_QSTR_bytearray_at, 23708, 12, "bytearray_at") +QDEF(MP_QSTR_byteorder, 39265, 9, "byteorder") +QDEF(MP_QSTR_bytes_at, 23990, 8, "bytes_at") +QDEF(MP_QSTR_calcsize, 14413, 8, "calcsize") +QDEF(MP_QSTR_callback, 61516, 8, "callback") +QDEF(MP_QSTR_cancel, 34563, 6, "cancel") +QDEF(MP_QSTR_ceil, 45062, 4, "ceil") +QDEF(MP_QSTR_center, 48974, 6, "center") +QDEF(MP_QSTR_chdir, 45745, 5, "chdir") +QDEF(MP_QSTR_choice, 13102, 6, "choice") +QDEF(MP_QSTR_closure, 51828, 7, "closure") +QDEF(MP_QSTR_cmath, 62646, 5, "cmath") +QDEF(MP_QSTR_code, 55912, 4, "code") +QDEF(MP_QSTR_collect, 26011, 7, "collect") +QDEF(MP_QSTR_compile, 51700, 7, "compile") +QDEF(MP_QSTR_complex, 40389, 7, "complex") +QDEF(MP_QSTR_connect, 15835, 7, "connect") +QDEF(MP_QSTR_copysign, 5171, 8, "copysign") +QDEF(MP_QSTR_coro, 56244, 4, "coro") +QDEF(MP_QSTR_cos, 19578, 3, "cos") +QDEF(MP_QSTR_crc32, 59510, 5, "crc32") +QDEF(MP_QSTR_cur_task, 11763, 8, "cur_task") +QDEF(MP_QSTR_data, 56341, 4, "data") +QDEF(MP_QSTR_decode, 22953, 6, "decode") +QDEF(MP_QSTR_decompress, 64354, 10, "decompress") +QDEF(MP_QSTR_default, 32206, 7, "default") +QDEF(MP_QSTR_degrees, 16642, 7, "degrees") +QDEF(MP_QSTR_deinit, 36254, 6, "deinit") +QDEF(MP_QSTR_delattr, 51419, 7, "delattr") +QDEF(MP_QSTR_deleter, 56174, 7, "deleter") +QDEF(MP_QSTR_deque, 39173, 5, "deque") +QDEF(MP_QSTR_dict_view, 43309, 9, "dict_view") +QDEF(MP_QSTR_difference, 9330, 10, "difference") +QDEF(MP_QSTR_difference_update, 64156, 17, "difference_update") +QDEF(MP_QSTR_digest, 50381, 6, "digest") +QDEF(MP_QSTR_disable, 30353, 7, "disable") +QDEF(MP_QSTR_discard, 28943, 7, "discard") +QDEF(MP_QSTR_doc, 7981, 3, "doc") +QDEF(MP_QSTR_done, 837, 4, "done") +QDEF(MP_QSTR_dump, 12265, 4, "dump") +QDEF(MP_QSTR_dumps, 11642, 5, "dumps") +QDEF(MP_QSTR_e, 46528, 1, "e") +QDEF(MP_QSTR_enable, 56836, 6, "enable") +QDEF(MP_QSTR_encode, 51779, 6, "encode") +QDEF(MP_QSTR_encoding, 39942, 8, "encoding") +QDEF(MP_QSTR_enumerate, 47729, 9, "enumerate") +QDEF(MP_QSTR_errno, 4545, 5, "errno") +QDEF(MP_QSTR_errorcode, 56592, 9, "errorcode") +QDEF(MP_QSTR_execfile, 10328, 8, "execfile") +QDEF(MP_QSTR_exit, 48773, 4, "exit") +QDEF(MP_QSTR_exp, 9416, 3, "exp") +QDEF(MP_QSTR_fabs, 4755, 4, "fabs") +QDEF(MP_QSTR_factorial, 13004, 9, "factorial") +QDEF(MP_QSTR_file, 13507, 4, "file") +QDEF(MP_QSTR_fileno, 30338, 6, "fileno") +QDEF(MP_QSTR_fill, 13514, 4, "fill") +QDEF(MP_QSTR_fill_rect, 60725, 9, "fill_rect") +QDEF(MP_QSTR_filter, 48677, 6, "filter") +QDEF(MP_QSTR_firstbit, 14624, 8, "firstbit") +QDEF(MP_QSTR_float, 17461, 5, "float") +QDEF(MP_QSTR_floor, 18045, 5, "floor") +QDEF(MP_QSTR_flush, 49505, 5, "flush") +QDEF(MP_QSTR_fmod, 17637, 4, "fmod") +QDEF(MP_QSTR_framebuf, 33385, 8, "framebuf") +QDEF(MP_QSTR_freq, 15077, 4, "freq") +QDEF(MP_QSTR_frexp, 38940, 5, "frexp") +QDEF(MP_QSTR_fromkeys, 48439, 8, "fromkeys") +QDEF(MP_QSTR_frozenset, 40173, 9, "frozenset") +QDEF(MP_QSTR_function, 551, 8, "function") +QDEF(MP_QSTR_gc, 28257, 2, "gc") +QDEF(MP_QSTR_generator, 50070, 9, "generator") +QDEF(MP_QSTR_get_ident, 45566, 9, "get_ident") +QDEF(MP_QSTR_getaddrinfo, 6254, 11, "getaddrinfo") +QDEF(MP_QSTR_getcwd, 53251, 6, "getcwd") +QDEF(MP_QSTR_getrandbits, 32102, 11, "getrandbits") +QDEF(MP_QSTR_getter, 45712, 6, "getter") +QDEF(MP_QSTR_getvalue, 44152, 8, "getvalue") +QDEF(MP_QSTR_group, 45242, 5, "group") +QDEF(MP_QSTR_handler, 24029, 7, "handler") +QDEF(MP_QSTR_heap_lock, 36013, 9, "heap_lock") +QDEF(MP_QSTR_heap_unlock, 11606, 11, "heap_unlock") +QDEF(MP_QSTR_heapify, 11695, 7, "heapify") +QDEF(MP_QSTR_heappop, 10198, 7, "heappop") +QDEF(MP_QSTR_heappush, 27527, 8, "heappush") +QDEF(MP_QSTR_help, 23700, 4, "help") +QDEF(MP_QSTR_hex, 20592, 3, "hex") +QDEF(MP_QSTR_hexlify, 32554, 7, "hexlify") +QDEF(MP_QSTR_hline, 15491, 5, "hline") +QDEF(MP_QSTR_ilistdir, 27249, 8, "ilistdir") +QDEF(MP_QSTR_imag, 46919, 4, "imag") +QDEF(MP_QSTR_implementation, 11543, 14, "implementation") +QDEF(MP_QSTR_indices, 18522, 7, "indices") +QDEF(MP_QSTR_inf, 21252, 3, "inf") +QDEF(MP_QSTR_init, 46111, 4, "init") +QDEF(MP_QSTR_input, 23155, 5, "input") +QDEF(MP_QSTR_intersection, 10792, 12, "intersection") +QDEF(MP_QSTR_intersection_update, 56582, 19, "intersection_update") +QDEF(MP_QSTR_invert, 183, 6, "invert") +QDEF(MP_QSTR_ioctl, 49784, 5, "ioctl") +QDEF(MP_QSTR_ipoll, 23891, 5, "ipoll") +QDEF(MP_QSTR_irq, 22159, 3, "irq") +QDEF(MP_QSTR_isclose, 20041, 7, "isclose") +QDEF(MP_QSTR_isdisjoint, 26871, 10, "isdisjoint") +QDEF(MP_QSTR_isenabled, 58778, 9, "isenabled") +QDEF(MP_QSTR_isfinite, 43942, 8, "isfinite") +QDEF(MP_QSTR_isinf, 4414, 5, "isinf") +QDEF(MP_QSTR_isnan, 926, 5, "isnan") +QDEF(MP_QSTR_issubset, 49593, 8, "issubset") +QDEF(MP_QSTR_issuperset, 60668, 10, "issuperset") +QDEF(MP_QSTR_iterable, 37413, 8, "iterable") +QDEF(MP_QSTR_iterator, 48711, 8, "iterator") +QDEF(MP_QSTR_kbd_intr, 5110, 8, "kbd_intr") +QDEF(MP_QSTR_keepends, 35682, 8, "keepends") +QDEF(MP_QSTR_ldexp, 28480, 5, "ldexp") +QDEF(MP_QSTR_line, 7371, 4, "line") +QDEF(MP_QSTR_listdir, 58264, 7, "listdir") +QDEF(MP_QSTR_listen, 3788, 6, "listen") +QDEF(MP_QSTR_load, 9315, 4, "load") +QDEF(MP_QSTR_loads, 45232, 5, "loads") +QDEF(MP_QSTR_lock, 9134, 4, "lock") +QDEF(MP_QSTR_locked, 47631, 6, "locked") +QDEF(MP_QSTR_log, 16161, 3, "log") +QDEF(MP_QSTR_machine, 43872, 7, "machine") +QDEF(MP_QSTR_makefile, 54721, 8, "makefile") +QDEF(MP_QSTR_match, 8854, 5, "match") +QDEF(MP_QSTR_math, 47925, 4, "math") +QDEF(MP_QSTR_max, 17329, 3, "max") +QDEF(MP_QSTR_maxsize, 28884, 7, "maxsize") +QDEF(MP_QSTR_mem, 17440, 3, "mem") +QDEF(MP_QSTR_mem16, 51719, 5, "mem16") +QDEF(MP_QSTR_mem32, 51777, 5, "mem32") +QDEF(MP_QSTR_mem8, 51224, 4, "mem8") +QDEF(MP_QSTR_mem_alloc, 11090, 9, "mem_alloc") +QDEF(MP_QSTR_mem_free, 25291, 8, "mem_free") +QDEF(MP_QSTR_mem_info, 61905, 8, "mem_info") +QDEF(MP_QSTR_memaddr, 59539, 7, "memaddr") +QDEF(MP_QSTR_memoryview, 17513, 10, "memoryview") +QDEF(MP_QSTR_min, 17071, 3, "min") +QDEF(MP_QSTR_miso, 39069, 4, "miso") +QDEF(MP_QSTR_mkdir, 46492, 5, "mkdir") +QDEF(MP_QSTR_mkfs, 45174, 4, "mkfs") +QDEF(MP_QSTR_mode, 49190, 4, "mode") +QDEF(MP_QSTR_modf, 49189, 4, "modf") +QDEF(MP_QSTR_modify, 26357, 6, "modify") +QDEF(MP_QSTR_module, 39359, 6, "module") +QDEF(MP_QSTR_modules, 53740, 7, "modules") +QDEF(MP_QSTR_mosi, 49693, 4, "mosi") +QDEF(MP_QSTR_mount, 3496, 5, "mount") +QDEF(MP_QSTR_name, 30114, 4, "name") +QDEF(MP_QSTR_namedtuple, 5662, 10, "namedtuple") +QDEF(MP_QSTR_nan, 22756, 3, "nan") +QDEF(MP_QSTR_network, 10331, 7, "network") +QDEF(MP_QSTR_newline, 35127, 7, "newline") +QDEF(MP_QSTR_nodename, 43874, 8, "nodename") +QDEF(MP_QSTR_oct, 23805, 3, "oct") +QDEF(MP_QSTR_off, 23690, 3, "off") +QDEF(MP_QSTR_on, 28516, 2, "on") +QDEF(MP_QSTR_opt_level, 26503, 9, "opt_level") +QDEF(MP_QSTR_pack, 53692, 4, "pack") +QDEF(MP_QSTR_pack_into, 43295, 9, "pack_into") +QDEF(MP_QSTR_partition, 58759, 9, "partition") +QDEF(MP_QSTR_path, 52872, 4, "path") +QDEF(MP_QSTR_peek, 49534, 4, "peek") +QDEF(MP_QSTR_pend_throw, 29939, 10, "pend_throw") +QDEF(MP_QSTR_period, 41120, 6, "period") +QDEF(MP_QSTR_ph_key, 6901, 6, "ph_key") +QDEF(MP_QSTR_phase, 54634, 5, "phase") +QDEF(MP_QSTR_pi, 28700, 2, "pi") +QDEF(MP_QSTR_pixel, 61517, 5, "pixel") +QDEF(MP_QSTR_platform, 6458, 8, "platform") +QDEF(MP_QSTR_polar, 3077, 5, "polar") +QDEF(MP_QSTR_polarity, 60737, 8, "polarity") +QDEF(MP_QSTR_poll, 55706, 4, "poll") +QDEF(MP_QSTR_popleft, 39537, 7, "popleft") +QDEF(MP_QSTR_print_exception, 8732, 15, "print_exception") +QDEF(MP_QSTR_property, 10690, 8, "property") +QDEF(MP_QSTR_ps1, 28919, 3, "ps1") +QDEF(MP_QSTR_ps2, 28916, 3, "ps2") +QDEF(MP_QSTR_push, 32443, 4, "push") +QDEF(MP_QSTR_pwd, 28710, 3, "pwd") +QDEF(MP_QSTR_qstr_info, 33200, 9, "qstr_info") +QDEF(MP_QSTR_r, 46551, 1, "r") +QDEF(MP_QSTR_radians, 16263, 7, "radians") +QDEF(MP_QSTR_randint, 56495, 7, "randint") +QDEF(MP_QSTR_random, 11454, 6, "random") +QDEF(MP_QSTR_randrange, 16035, 9, "randrange") +QDEF(MP_QSTR_rb, 28885, 2, "rb") +QDEF(MP_QSTR_readblocks, 7213, 10, "readblocks") +QDEF(MP_QSTR_readfrom, 45377, 8, "readfrom") +QDEF(MP_QSTR_readfrom_into, 16258, 13, "readfrom_into") +QDEF(MP_QSTR_readfrom_mem, 25915, 12, "readfrom_mem") +QDEF(MP_QSTR_readfrom_mem_into, 36408, 17, "readfrom_mem_into") +QDEF(MP_QSTR_readlines, 22890, 9, "readlines") +QDEF(MP_QSTR_readonly, 35075, 8, "readonly") +QDEF(MP_QSTR_real, 63935, 4, "real") +QDEF(MP_QSTR_rect, 63973, 4, "rect") +QDEF(MP_QSTR_recv, 63975, 4, "recv") +QDEF(MP_QSTR_recvfrom, 37009, 8, "recvfrom") +QDEF(MP_QSTR_register, 41388, 8, "register") +QDEF(MP_QSTR_rel_tol, 18006, 7, "rel_tol") +QDEF(MP_QSTR_release, 36844, 7, "release") +QDEF(MP_QSTR_rename, 6197, 6, "rename") +QDEF(MP_QSTR_reversed, 28321, 8, "reversed") +QDEF(MP_QSTR_rmdir, 42821, 5, "rmdir") +QDEF(MP_QSTR_route, 10300, 5, "route") +QDEF(MP_QSTR_rpartition, 53269, 10, "rpartition") +QDEF(MP_QSTR_rxbuf, 26494, 5, "rxbuf") +QDEF(MP_QSTR_scan, 36378, 4, "scan") +QDEF(MP_QSTR_schedule, 44256, 8, "schedule") +QDEF(MP_QSTR_sck, 36862, 3, "sck") +QDEF(MP_QSTR_scl, 36857, 3, "scl") +QDEF(MP_QSTR_scroll, 23080, 6, "scroll") +QDEF(MP_QSTR_sda, 36691, 3, "sda") +QDEF(MP_QSTR_search, 49579, 6, "search") +QDEF(MP_QSTR_seed, 30098, 4, "seed") +QDEF(MP_QSTR_seek, 30109, 4, "seek") +QDEF(MP_QSTR_select, 16781, 6, "select") +QDEF(MP_QSTR_sendall, 40760, 7, "sendall") +QDEF(MP_QSTR_sendto, 802, 6, "sendto") +QDEF(MP_QSTR_separators, 3307, 10, "separators") +QDEF(MP_QSTR_setblocking, 6254, 11, "setblocking") +QDEF(MP_QSTR_setsockopt, 59448, 10, "setsockopt") +QDEF(MP_QSTR_setter, 22788, 6, "setter") +QDEF(MP_QSTR_settimeout, 35548, 10, "settimeout") +QDEF(MP_QSTR_sha256, 302, 6, "sha256") +QDEF(MP_QSTR_sin, 37041, 3, "sin") +QDEF(MP_QSTR_single, 8255, 6, "single") +QDEF(MP_QSTR_sizeof, 29513, 6, "sizeof") +QDEF(MP_QSTR_sleep, 10218, 5, "sleep") +QDEF(MP_QSTR_sleep_ms, 25355, 8, "sleep_ms") +QDEF(MP_QSTR_slice, 62645, 5, "slice") +QDEF(MP_QSTR_socket, 52320, 6, "socket") +QDEF(MP_QSTR_soft_reset, 26081, 10, "soft_reset") +QDEF(MP_QSTR_splitlines, 54122, 10, "splitlines") +QDEF(MP_QSTR_sqrt, 17441, 4, "sqrt") +QDEF(MP_QSTR_ssid, 19208, 4, "ssid") +QDEF(MP_QSTR_stack_size, 15153, 10, "stack_size") +QDEF(MP_QSTR_stack_use, 63383, 9, "stack_use") +QDEF(MP_QSTR_start_new_thread, 9687, 16, "start_new_thread") +QDEF(MP_QSTR_stat, 13783, 4, "stat") +QDEF(MP_QSTR_state, 61650, 5, "state") +QDEF(MP_QSTR_statvfs, 6420, 7, "statvfs") +QDEF(MP_QSTR_stderr, 22691, 6, "stderr") +QDEF(MP_QSTR_stdin, 1057, 5, "stdin") +QDEF(MP_QSTR_stdout, 33544, 6, "stdout") +QDEF(MP_QSTR_struct, 36882, 6, "struct") +QDEF(MP_QSTR_sub, 36129, 3, "sub") +QDEF(MP_QSTR_symmetric_difference, 26574, 20, "symmetric_difference") +QDEF(MP_QSTR_symmetric_difference_update, 63584, 27, "symmetric_difference_update") +QDEF(MP_QSTR_sync, 25250, 4, "sync") +QDEF(MP_QSTR_sys, 36540, 3, "sys") +QDEF(MP_QSTR_sysname, 13979, 7, "sysname") +QDEF(MP_QSTR_tan, 25086, 3, "tan") +QDEF(MP_QSTR_tau, 25061, 3, "tau") +QDEF(MP_QSTR_tell, 45332, 4, "tell") +QDEF(MP_QSTR_text, 44952, 4, "text") +QDEF(MP_QSTR_threshold, 12274, 9, "threshold") +QDEF(MP_QSTR_tick_hz, 56189, 7, "tick_hz") +QDEF(MP_QSTR_ticks_add, 44701, 9, "ticks_add") +QDEF(MP_QSTR_ticks_cpu, 42266, 9, "ticks_cpu") +QDEF(MP_QSTR_ticks_diff, 57521, 10, "ticks_diff") +QDEF(MP_QSTR_ticks_ms, 12866, 8, "ticks_ms") +QDEF(MP_QSTR_timeout, 21566, 7, "timeout") +QDEF(MP_QSTR_timeout_char, 19065, 12, "timeout_char") +QDEF(MP_QSTR_trigger, 35997, 7, "trigger") +QDEF(MP_QSTR_trunc, 39259, 5, "trunc") +QDEF(MP_QSTR_uarray, 34441, 6, "uarray") +QDEF(MP_QSTR_ubinascii, 35012, 9, "ubinascii") +QDEF(MP_QSTR_ucollections, 39445, 12, "ucollections") +QDEF(MP_QSTR_uctypes, 29176, 7, "uctypes") +QDEF(MP_QSTR_uerrno, 59828, 6, "uerrno") +QDEF(MP_QSTR_uhashlib, 40293, 8, "uhashlib") +QDEF(MP_QSTR_uheapq, 17181, 6, "uheapq") +QDEF(MP_QSTR_uio, 26294, 3, "uio") +QDEF(MP_QSTR_ujson, 12520, 5, "ujson") +QDEF(MP_QSTR_umachine, 32661, 8, "umachine") +QDEF(MP_QSTR_umount, 40669, 6, "umount") +QDEF(MP_QSTR_uname, 40119, 5, "uname") +QDEF(MP_QSTR_unhexlify, 47537, 9, "unhexlify") +QDEF(MP_QSTR_uniform, 62721, 7, "uniform") +QDEF(MP_QSTR_union, 31990, 5, "union") +QDEF(MP_QSTR_unlink, 36862, 6, "unlink") +QDEF(MP_QSTR_unpack, 15367, 6, "unpack") +QDEF(MP_QSTR_unpack_from, 27918, 11, "unpack_from") +QDEF(MP_QSTR_unregister, 54295, 10, "unregister") +QDEF(MP_QSTR_uos, 26604, 3, "uos") +QDEF(MP_QSTR_urandom, 44715, 7, "urandom") +QDEF(MP_QSTR_ure, 25479, 3, "ure") +QDEF(MP_QSTR_uselect, 36440, 7, "uselect") +QDEF(MP_QSTR_usocket, 117, 7, "usocket") +QDEF(MP_QSTR_ustruct, 2119, 7, "ustruct") +QDEF(MP_QSTR_usys, 62409, 4, "usys") +QDEF(MP_QSTR_utime, 40421, 5, "utime") +QDEF(MP_QSTR_uzlib, 39789, 5, "uzlib") +QDEF(MP_QSTR_version, 54207, 7, "version") +QDEF(MP_QSTR_version_info, 2670, 12, "version_info") +QDEF(MP_QSTR_vline, 63005, 5, "vline") +QDEF(MP_QSTR_write_readinto, 33929, 14, "write_readinto") +QDEF(MP_QSTR_writeblocks, 57090, 11, "writeblocks") +QDEF(MP_QSTR_writeto, 14595, 7, "writeto") +QDEF(MP_QSTR_writeto_mem, 60793, 11, "writeto_mem") +QDEF(MP_QSTR_writevto, 30069, 8, "writevto") diff --git a/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/startup_stm32l431xx.s b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/startup_stm32l431xx.s new file mode 100644 index 00000000..6a5c15a5 --- /dev/null +++ b/board/BearPi_STM32L431RC/KEIL/micropython_extra_demo/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power devices vector table for MDK-ARM toolchain. +;* This module performs: +;* - Set the initial SP +;* - Set the initial PC == Reset_Handler +;* - Set the vector table entries with the exceptions ISR address +;* - Branches to __main in the C library (which eventually +;* calls main()). +;* After Reset the Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; Amount of memory (in bytes) allocated for Stack +; Tailor this value to your application needs +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x100 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x100 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDG_IRQHandler ; Window WatchDog + DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS interrupt + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +; Reset handler +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_PVM_IRQHandler [WEAK] + EXPORT TAMP_STAMP_IRQHandler [WEAK] + EXPORT RTC_WKUP_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT RCC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT DMA1_Channel5_IRQHandler [WEAK] + EXPORT DMA1_Channel6_IRQHandler [WEAK] + EXPORT DMA1_Channel7_IRQHandler [WEAK] + EXPORT ADC1_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT I2C2_EV_IRQHandler [WEAK] + EXPORT I2C2_ER_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_IRQHandler [WEAK] + EXPORT DMA2_Channel1_IRQHandler [WEAK] + EXPORT DMA2_Channel2_IRQHandler [WEAK] + EXPORT DMA2_Channel3_IRQHandler [WEAK] + EXPORT DMA2_Channel4_IRQHandler [WEAK] + EXPORT DMA2_Channel5_IRQHandler [WEAK] + EXPORT COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_IRQHandler +RTC_WKUP_IRQHandler +FLASH_IRQHandler +RCC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +DMA1_Channel5_IRQHandler +DMA1_Channel6_IRQHandler +DMA1_Channel7_IRQHandler +ADC1_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_IRQHandler + + B . + + ENDP + + ALIGN + +;******************************************************************************* +; User Stack and Heap initialization +;******************************************************************************* + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + END + +;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** diff --git a/components/language/micropython/.git-blame-ignore-revs b/components/language/micropython/.git-blame-ignore-revs new file mode 100644 index 00000000..0ffa4fcf --- /dev/null +++ b/components/language/micropython/.git-blame-ignore-revs @@ -0,0 +1,47 @@ +#all: Reformat remaining C code that doesn't have a space after a comma. +5b700b0af90591d6b1a2c087bb8de6b7f1bfdd2d + +# ports: Reformat more C and Python source code. +5c32111fa0e31e451b0f1666bdf926be2fdfd82c + +# all: Update Python formatting to latest Black version 22.1.0. +ab2923dfa1174dc177f0a90cb00a7e4ff87958d2 + +# all: Update Python formatting to latest Black version 21.12b0. +3770fab33449a5dadf8eb06edfae0767e75320a6 + +# tools/gen-cpydiff.py: Fix formatting of doc strings for new Black. +0f78c36c5aa458a954eed39a46942209107a553e + +# tests/run-tests.py: Reformat with Black. +2a38d7103672580882fb621a5b76e8d26805d593 + +# all: Update Python code to conform to latest black formatting. +06659077a81b85882254cf0953c33b27614e018e + +# tools/uncrustify: Enable more opts to remove space between func and '('. +77ed6f69ac35c1663a5633a8ee1d8a2446542204 + +# tools/codeformat.py: Include extmod/{btstack,nimble} in code formatting. +026fda605e03113d6e753290d65fed774418bc53 + +# all: Format code to add space after C++-style comment start. +84fa3312cfa7d2237d4b56952f2cd6e3591210c4 + +# tests: Format all Python code with black, except tests in basics subdir. +3dc324d3f1312e40d3a8ed87e7244966bb756f26 + +# all: Remove spaces inside and around parenthesis. +1a3e386c67e03a79eb768cb6e9f6777e002d6660 + +# all: Remove spaces between nested paren and inside function arg paren. +feb25775851ba0c04b8d1013716f442258879d9c + +# all: Reformat C and Python source code with tools/codeformat.py. +69661f3343bedf86e514337cff63d96cc42f8859 + +# stm32/usbdev: Convert files to unix line endings. +abde0fa2267f9062b28c3c015d7662a550125cc6 + +# all: Remove trailing spaces, per coding conventions. +761e4c7ff62896c7d8f8c3dfc3cc98a4cc4f2f6f diff --git a/components/language/micropython/.gitattributes b/components/language/micropython/.gitattributes new file mode 100644 index 00000000..e6d31d6a --- /dev/null +++ b/components/language/micropython/.gitattributes @@ -0,0 +1,26 @@ +# Per default everything gets normalized and gets LF line endings on checkout. +* text eol=lf + +# These will always have CRLF line endings on checkout. +*.vcxproj text eol=crlf +*.props text eol=crlf +*.bat text eol=crlf + +# These are binary so should never be modified by git. +*.a binary +*.png binary +*.jpg binary +*.dxf binary +*.mpy binary + +# These should also not be modified by git. +tests/basics/string_cr_conversion.py -text +tests/basics/string_crlf_conversion.py -text +ports/stm32/pybcdc.inf_template -text +ports/stm32/usbhost/** -text +ports/cc3200/hal/aes.c -text +ports/cc3200/hal/aes.h -text +ports/cc3200/hal/des.c -text +ports/cc3200/hal/i2s.c -text +ports/cc3200/hal/i2s.h -text +ports/cc3200/version.h -text diff --git a/components/language/micropython/.github/FUNDING.yml b/components/language/micropython/.github/FUNDING.yml new file mode 100644 index 00000000..15186fd5 --- /dev/null +++ b/components/language/micropython/.github/FUNDING.yml @@ -0,0 +1 @@ +github: micropython diff --git a/components/language/micropython/.github/ISSUE_TEMPLATE/bug_report.md b/components/language/micropython/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..adddd334 --- /dev/null +++ b/components/language/micropython/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Report an issue +title: '' +labels: bug +assignees: '' + +--- + +* Remove all placeholder text below before submitting. + +* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, please see the MicroPython Forum -- https://forum.micropython.org/ + +* In your issue, please include a clear and concise description of what the bug is, the expected output, and how to replicate it. + +* If this issue involves external hardware, please include links to relevant datasheets and schematics. + +* If you are seeing code being executed incorrectly, please provide a minimal example and expected output (e.g. comparison to CPython). + +* For build issues, please include full details of your environment, compiler versions, command lines, and build output. + +* Please provide as much information as possible about the version of MicroPython you're running, such as: + - firmware file name + - git commit hash and port/board + - version information shown in the REPL (hit Ctrl-B to see the startup message) diff --git a/components/language/micropython/.github/ISSUE_TEMPLATE/config.yml b/components/language/micropython/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..318d9416 --- /dev/null +++ b/components/language/micropython/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: MicroPython Forum + url: https://forum.micropython.org/ + about: Community discussion about all things MicroPython. This is the best place to start if you have questions about using MicroPython or getting started with MicroPython development. + - name: MicroPython Documentation + url: https://docs.micropython.org/ + about: Documentation for using and working with MicroPython and libraries. + - name: MicroPython Downloads + url: https://micropython.org/download/ + about: Pre-built firmware and information for most supported boards. diff --git a/components/language/micropython/.github/ISSUE_TEMPLATE/documentation.md b/components/language/micropython/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 00000000..84ff2ba6 --- /dev/null +++ b/components/language/micropython/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,16 @@ +--- +name: Documentation issue +about: Report areas of the documentation or examples that need improvement +title: 'docs: ' +labels: documentation +assignees: '' + +--- + +* Remove all placeholder text below before submitting. + +* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, please see the MicroPython Forum -- https://forum.micropython.org/ + +* Describe what was missing from the documentation and/or what was incorrect/incomplete. + +* If possible, please link to the relevant page on https://docs.micropython.org/ diff --git a/components/language/micropython/.github/ISSUE_TEMPLATE/feature_request.md b/components/language/micropython/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..1ac2055e --- /dev/null +++ b/components/language/micropython/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature request +about: Request a feature or improvement +title: '' +labels: enhancement +assignees: '' + +--- + +* Remove all placeholder text below before submitting. + +* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, please see the MicroPython Forum -- https://forum.micropython.org/ + +* Describe the feature you'd like to see added to MicroPython. In particular, what does this feature enable and why is it useful. MicroPython aims to strike a balance between functionality and code size, so please consider whether this feature can be optionally enabled and whether it can be provided in other ways (e.g. pure-Python library). + +* For core Python features, where possible please include a link to the relevant PEP. + +* For new architectures / ports / boards, please provide links to relevant documentation, specifications, and toolchains. Any information about the popularity and unique features about this hardware would also be useful. + +* For features for existing ports (e.g. new peripherals or microcontroller features), please describe which port(s) it applies too, and whether this is could be an extension to the machine API or a port-specific module? + +* For drivers (e.g. for external hardware), please link to datasheets and/or existing drivers from other sources. + +* Who do you expect will implement the feature you are requesting? Would you be willing to sponsor this work? diff --git a/components/language/micropython/.github/ISSUE_TEMPLATE/security.md b/components/language/micropython/.github/ISSUE_TEMPLATE/security.md new file mode 100644 index 00000000..fe60875f --- /dev/null +++ b/components/language/micropython/.github/ISSUE_TEMPLATE/security.md @@ -0,0 +1,16 @@ +--- +name: Security report +about: Report a security issue or vunerability in MicroPython +title: '' +labels: security +assignees: '' + +--- + +* Remove all placeholder text before submitting the new issue. + +* If you need to raise this issue privately with the MicroPython team, please email contact@micropython.org instead. + +* Include a clear and concise description of what the security issue is. + +* What does this issue allow an attacker to do? diff --git a/components/language/micropython/.github/workflows/code_formatting.yml b/components/language/micropython/.github/workflows/code_formatting.yml new file mode 100644 index 00000000..aab347d7 --- /dev/null +++ b/components/language/micropython/.github/workflows/code_formatting.yml @@ -0,0 +1,16 @@ +name: Check code formatting + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + - name: Install packages + run: source tools/ci.sh && ci_code_formatting_setup + - name: Run code formatting + run: source tools/ci.sh && ci_code_formatting_run + - name: Check code formatting + run: git diff --exit-code diff --git a/components/language/micropython/.github/workflows/code_size.yml b/components/language/micropython/.github/workflows/code_size.yml new file mode 100644 index 00000000..7570261e --- /dev/null +++ b/components/language/micropython/.github/workflows/code_size.yml @@ -0,0 +1,27 @@ +name: Check code size + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'ports/bare-arm/**' + - 'ports/minimal/**' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 100 + - name: Install packages + run: source tools/ci.sh && ci_code_size_setup + - name: Build + run: source tools/ci.sh && ci_code_size_build + - name: Compute code size difference + run: tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1 diff --git a/components/language/micropython/.github/workflows/commit_formatting.yml b/components/language/micropython/.github/workflows/commit_formatting.yml new file mode 100644 index 00000000..5f96fbb9 --- /dev/null +++ b/components/language/micropython/.github/workflows/commit_formatting.yml @@ -0,0 +1,14 @@ +name: Check commit message formatting + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '100' + - uses: actions/setup-python@v1 + - name: Check commit message formatting + run: source tools/ci.sh && ci_commit_formatting_run diff --git a/components/language/micropython/.github/workflows/docs.yml b/components/language/micropython/.github/workflows/docs.yml new file mode 100644 index 00000000..ec6b4c7f --- /dev/null +++ b/components/language/micropython/.github/workflows/docs.yml @@ -0,0 +1,18 @@ +name: Build docs + +on: + pull_request: + paths: + - docs/** + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + - name: Install Python packages + run: pip install Sphinx + - name: Build docs + run: make -C docs/ html diff --git a/components/language/micropython/.github/workflows/examples.yml b/components/language/micropython/.github/workflows/examples.yml new file mode 100644 index 00000000..53a817af --- /dev/null +++ b/components/language/micropython/.github/workflows/examples.yml @@ -0,0 +1,21 @@ +name: Check examples + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'examples/**' + - 'ports/unix/**' + - 'py/**' + - 'shared/**' + +jobs: + embedding: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: make -C examples/embedding + - name: Run + run: test "$(./examples/embedding/hello-embed)" = "Hello world of easy embedding!" diff --git a/components/language/micropython/.github/workflows/mpy_format.yml b/components/language/micropython/.github/workflows/mpy_format.yml new file mode 100644 index 00000000..ab90bb33 --- /dev/null +++ b/components/language/micropython/.github/workflows/mpy_format.yml @@ -0,0 +1,18 @@ +name: .mpy file format and tools + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_mpy_format_setup + - name: Test mpy-tool.py + run: source tools/ci.sh && ci_mpy_format_test diff --git a/components/language/micropython/.github/workflows/ports.yml b/components/language/micropython/.github/workflows/ports.yml new file mode 100644 index 00000000..e9e6de28 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports.yml @@ -0,0 +1,18 @@ +name: Build ports metadata + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - ports/** + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build ports download metadata + run: mkdir boards && ./tools/autobuild/build-downloads.py . ./boards diff --git a/components/language/micropython/.github/workflows/ports_cc3200.yml b/components/language/micropython/.github/workflows/ports_cc3200.yml new file mode 100644 index 00000000..0eaa36da --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_cc3200.yml @@ -0,0 +1,23 @@ +name: cc3200 port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/cc3200/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_cc3200_setup + - name: Build + run: source tools/ci.sh && ci_cc3200_build diff --git a/components/language/micropython/.github/workflows/ports_esp32.yml b/components/language/micropython/.github/workflows/ports_esp32.yml new file mode 100644 index 00000000..de88de37 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_esp32.yml @@ -0,0 +1,32 @@ +name: esp32 port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/esp32/**' + +jobs: + build_idf402: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_esp32_idf402_setup + - name: Build + run: source tools/ci.sh && ci_esp32_build + + build_idf44: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_esp32_idf44_setup + - name: Build + run: source tools/ci.sh && ci_esp32_build diff --git a/components/language/micropython/.github/workflows/ports_esp8266.yml b/components/language/micropython/.github/workflows/ports_esp8266.yml new file mode 100644 index 00000000..f4ce1f82 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_esp8266.yml @@ -0,0 +1,23 @@ +name: esp8266 port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/esp8266/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_esp8266_setup && ci_esp8266_path >> $GITHUB_PATH + - name: Build + run: source tools/ci.sh && ci_esp8266_build diff --git a/components/language/micropython/.github/workflows/ports_javascript.yml b/components/language/micropython/.github/workflows/ports_javascript.yml new file mode 100644 index 00000000..244dc966 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_javascript.yml @@ -0,0 +1,24 @@ +name: javascript port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'ports/javascript/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_javascript_setup + - name: Build + run: source tools/ci.sh && ci_javascript_build + - name: Run tests + run: source tools/ci.sh && ci_javascript_run_tests diff --git a/components/language/micropython/.github/workflows/ports_mimxrt.yml b/components/language/micropython/.github/workflows/ports_mimxrt.yml new file mode 100644 index 00000000..8fbc2209 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_mimxrt.yml @@ -0,0 +1,23 @@ +name: mimxrt port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/mimxrt/**' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_mimxrt_setup + - name: Build + run: source tools/ci.sh && ci_mimxrt_build diff --git a/components/language/micropython/.github/workflows/ports_nrf.yml b/components/language/micropython/.github/workflows/ports_nrf.yml new file mode 100644 index 00000000..1ba3b0ce --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_nrf.yml @@ -0,0 +1,23 @@ +name: nrf port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/nrf/**' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_nrf_setup + - name: Build + run: source tools/ci.sh && ci_nrf_build diff --git a/components/language/micropython/.github/workflows/ports_powerpc.yml b/components/language/micropython/.github/workflows/ports_powerpc.yml new file mode 100644 index 00000000..88fa5976 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_powerpc.yml @@ -0,0 +1,23 @@ +name: powerpc port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/powerpc/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_powerpc_setup + - name: Build + run: source tools/ci.sh && ci_powerpc_build diff --git a/components/language/micropython/.github/workflows/ports_qemu-arm.yml b/components/language/micropython/.github/workflows/ports_qemu-arm.yml new file mode 100644 index 00000000..0489a93d --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_qemu-arm.yml @@ -0,0 +1,27 @@ +name: qemu-arm port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/qemu-arm/**' + - 'tests/**' + +jobs: + build_and_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_qemu_arm_setup + - name: Build and run test suite + run: source tools/ci.sh && ci_qemu_arm_build + - name: Print failures + if: failure() + run: grep --before-context=100 --text "FAIL" ports/qemu-arm/build/console.out diff --git a/components/language/micropython/.github/workflows/ports_renesas-ra.yml b/components/language/micropython/.github/workflows/ports_renesas-ra.yml new file mode 100644 index 00000000..20e068ee --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_renesas-ra.yml @@ -0,0 +1,24 @@ +name: renesas-ra port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/renesas-ra/**' + +jobs: + build_renesas_ra_board: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_renesas_ra_setup + - name: Build + run: source tools/ci.sh && ci_renesas_ra_board_build + diff --git a/components/language/micropython/.github/workflows/ports_rp2.yml b/components/language/micropython/.github/workflows/ports_rp2.yml new file mode 100644 index 00000000..668b79ca --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_rp2.yml @@ -0,0 +1,23 @@ +name: rp2 port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/rp2/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_rp2_setup + - name: Build + run: source tools/ci.sh && ci_rp2_build diff --git a/components/language/micropython/.github/workflows/ports_samd.yml b/components/language/micropython/.github/workflows/ports_samd.yml new file mode 100644 index 00000000..bde4ed96 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_samd.yml @@ -0,0 +1,23 @@ +name: samd port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/samd/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_samd_setup + - name: Build + run: source tools/ci.sh && ci_samd_build diff --git a/components/language/micropython/.github/workflows/ports_stm32.yml b/components/language/micropython/.github/workflows/ports_stm32.yml new file mode 100644 index 00000000..4634339c --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_stm32.yml @@ -0,0 +1,32 @@ +name: stm32 port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/stm32/**' + +jobs: + build_pyb: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_stm32_setup + - name: Build + run: source tools/ci.sh && ci_stm32_pyb_build + + build_nucleo: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_stm32_setup + - name: Build + run: source tools/ci.sh && ci_stm32_nucleo_build diff --git a/components/language/micropython/.github/workflows/ports_teensy.yml b/components/language/micropython/.github/workflows/ports_teensy.yml new file mode 100644 index 00000000..7ae77c80 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_teensy.yml @@ -0,0 +1,23 @@ +name: teensy port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'drivers/**' + - 'ports/teensy/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_teensy_setup + - name: Build + run: source tools/ci.sh && ci_teensy_build diff --git a/components/language/micropython/.github/workflows/ports_unix.yml b/components/language/micropython/.github/workflows/ports_unix.yml new file mode 100644 index 00000000..63cc1c0f --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_unix.yml @@ -0,0 +1,230 @@ +name: unix port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'examples/**' + - 'ports/unix/**' + - 'tests/**' + +jobs: + minimal: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: source tools/ci.sh && ci_unix_minimal_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_minimal_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + reproducible: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build with reproducible date + run: source tools/ci.sh && ci_unix_minimal_build + env: + SOURCE_DATE_EPOCH: 1234567890 + - name: Check reproducible build date + run: echo | ports/unix/micropython-minimal -i | grep 'on 2009-02-13;' + + standard: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: source tools/ci.sh && ci_unix_standard_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_standard_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + dev: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: source tools/ci.sh && ci_unix_dev_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_dev_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_coverage_setup + - name: Build + run: source tools/ci.sh && ci_unix_coverage_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_coverage_run_tests + - name: Test merging .mpy files + run: source tools/ci.sh && ci_unix_coverage_run_mpy_merge_tests + - name: Build native mpy modules + run: source tools/ci.sh && ci_native_mpy_modules_build + - name: Test importing .mpy generated by mpy_ld.py + run: source tools/ci.sh && ci_unix_coverage_run_native_mpy_tests + - name: Run gcov coverage analysis + run: | + (cd ports/unix && gcov -o build-coverage/py ../../py/*.c || true) + (cd ports/unix && gcov -o build-coverage/extmod ../../extmod/*.c || true) + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: true + verbose: true + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + coverage_32bit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_32bit_setup + - name: Build + run: source tools/ci.sh && ci_unix_coverage_32bit_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_coverage_32bit_run_tests + - name: Build native mpy modules + run: source tools/ci.sh && ci_native_mpy_modules_32bit_build + - name: Test importing .mpy generated by mpy_ld.py + run: source tools/ci.sh && ci_unix_coverage_32bit_run_native_mpy_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + nanbox: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_32bit_setup + - name: Build + run: source tools/ci.sh && ci_unix_nanbox_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_nanbox_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + float: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: source tools/ci.sh && ci_unix_float_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_float_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + stackless_clang: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_clang_setup + - name: Build + run: source tools/ci.sh && ci_unix_stackless_clang_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_stackless_clang_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + float_clang: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_clang_setup + - name: Build + run: source tools/ci.sh && ci_unix_float_clang_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_float_clang_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + settrace: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: source tools/ci.sh && ci_unix_settrace_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_settrace_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + settrace_stackless: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: source tools/ci.sh && ci_unix_settrace_stackless_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_settrace_stackless_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + macos: + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Build + run: source tools/ci.sh && ci_unix_macos_build + - name: Run tests + run: source tools/ci.sh && ci_unix_macos_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + qemu_mips: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_qemu_mips_setup + - name: Build + run: source tools/ci.sh && ci_unix_qemu_mips_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_qemu_mips_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures + + qemu_arm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_qemu_arm_setup + - name: Build + run: source tools/ci.sh && ci_unix_qemu_arm_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_qemu_arm_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures diff --git a/components/language/micropython/.github/workflows/ports_windows.yml b/components/language/micropython/.github/workflows/ports_windows.yml new file mode 100644 index 00000000..1bfe40c7 --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_windows.yml @@ -0,0 +1,23 @@ +name: windows port + +on: + push: + pull_request: + paths: + - '.github/workflows/*.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'ports/unix/**' + - 'ports/windows/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_windows_setup + - name: Build + run: source tools/ci.sh && ci_windows_build diff --git a/components/language/micropython/.github/workflows/ports_zephyr.yml b/components/language/micropython/.github/workflows/ports_zephyr.yml new file mode 100644 index 00000000..d9ae2b8c --- /dev/null +++ b/components/language/micropython/.github/workflows/ports_zephyr.yml @@ -0,0 +1,24 @@ +name: zephyr port + +on: + push: + pull_request: + paths: + - '.github/workflows/ports_zephyr.yml' + - 'tools/**' + - 'py/**' + - 'extmod/**' + - 'lib/**' + - 'ports/zephyr/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_zephyr_setup + - name: Install Zephyr + run: source tools/ci.sh && ci_zephyr_install + - name: Build + run: source tools/ci.sh && ci_zephyr_build diff --git a/components/language/micropython/.gitignore b/components/language/micropython/.gitignore new file mode 100644 index 00000000..73424899 --- /dev/null +++ b/components/language/micropython/.gitignore @@ -0,0 +1,48 @@ +# Compiled Sources +################### +*.o +*.a +*.elf +*.bin +*.map +*.hex +*.dis +*.exe + +# Packages +############ + +# Logs and Databases +###################### +*.log + +# VIM Swap Files +###################### +*.swp + +# Build directories +###################### +build/ +build-*/ + +# Test failure outputs +###################### +tests/results/* + +# Python cache files +###################### +__pycache__/ +*.pyc + +# Customized Makefile/project overrides +###################### +GNUmakefile +user.props + +# Generated rst files +###################### +genrst/ + +# MacOS desktop metadata files +###################### +.DS_Store diff --git a/components/language/micropython/.gitmodules b/components/language/micropython/.gitmodules new file mode 100644 index 00000000..118e023d --- /dev/null +++ b/components/language/micropython/.gitmodules @@ -0,0 +1,52 @@ +[submodule "lib/axtls"] + path = lib/axtls + url = https://github.com/micropython/axtls.git +[submodule "lib/libffi"] + path = lib/libffi + url = https://github.com/atgreen/libffi +[submodule "lib/lwip"] + path = lib/lwip + url = https://github.com/lwip-tcpip/lwip.git +[submodule "lib/berkeley-db-1.xx"] + path = lib/berkeley-db-1.xx + url = https://github.com/pfalcon/berkeley-db-1.xx +[submodule "lib/stm32lib"] + path = lib/stm32lib + url = https://github.com/micropython/stm32lib + branch = work-F0-1.9.0+F4-1.16.0+F7-1.7.0+G4-1.3.0+H7-1.6.0+L0-1.11.2+L4-1.17.0+WB-1.10.0+WL-1.1.0 +[submodule "lib/nrfx"] + path = lib/nrfx + url = https://github.com/NordicSemiconductor/nrfx.git +[submodule "lib/mbedtls"] + path = lib/mbedtls + url = https://github.com/ARMmbed/mbedtls.git +[submodule "lib/asf4"] + path = lib/asf4 + url = https://github.com/adafruit/asf4 + branch = circuitpython +[submodule "lib/tinyusb"] + path = lib/tinyusb + url = https://github.com/hathach/tinyusb +[submodule "lib/mynewt-nimble"] + path = lib/mynewt-nimble + url = https://github.com/micropython/mynewt-nimble.git +[submodule "lib/btstack"] + path = lib/btstack + url = https://github.com/bluekitchen/btstack.git +[submodule "lib/nxp_driver"] + path = lib/nxp_driver + url = https://github.com/hathach/nxp_driver.git +[submodule "lib/libhydrogen"] + path = lib/libhydrogen + url = https://github.com/jedisct1/libhydrogen.git +[submodule "lib/pico-sdk"] + path = lib/pico-sdk + url = https://github.com/raspberrypi/pico-sdk.git +[submodule "lib/fsp"] + path = lib/fsp + url = https://github.com/renesas/fsp.git +[submodule "lib/wiznet"] + path = lib/wiznet5k + url = https://github.com/andrewleech/wiznet_ioLibrary_Driver.git + # Requires https://github.com/Wiznet/ioLibrary_Driver/pull/120 + # url = https://github.com/Wiznet/ioLibrary_Driver.git diff --git a/components/language/micropython/ACKNOWLEDGEMENTS b/components/language/micropython/ACKNOWLEDGEMENTS new file mode 100644 index 00000000..41ed6bf2 --- /dev/null +++ b/components/language/micropython/ACKNOWLEDGEMENTS @@ -0,0 +1,1764 @@ +The MicroPython project was proudly and successfully crowdfunded +via a Kickstarter campaign which ended on 13th December 2013. The +project was supported by 1923 very generous backers, who pledged +for a total of 2320 pyboards. + +Damien George, the project creator, is grateful to the people +listed below (and others who asked not to be named), whose support +of the project help make the code in this repository what it is +today. The names appear in order of pledging. + + 3 Cliff Senkbeil + 4 MacDefender (http://www.macdefender.org) + 11 Shaun Walker - http://theshaun.com + 12 Robert Joscelyne + 17 Peter Simon, Germany + 18 theNetImp + 21 Eamonn Maguire + 22 Rob Knegjens + 27 Greg, https://www.logre.eu + 28 Rick S + 30 Norman Jaffe (OpenDragon) + 34 UltraBob was here. + 35 Geoffrey R. Thompson + 36 MrAtoni + 40 Proud to be a backer of Micro Python, Phil C. United Kingdom. + 42 www.babybadger.co.uk + 45 Mert + 46 Miles Cederman-Haysom + 47 unixarmy.com + 52 Proud to be here! Tonton Pommes + 54 Espen Sae-Tang Ottersen + 56 howang.hk + 58 Innovatology + 59 Marzsman + 63 Tristan A. Hearn + 64 Patrick Clarke + 65 Bryan Lyon + 70 Craig Burkhead + 72 Dr Igor Vizir + 73 Steve Iltis, @steven_iltis + 79 www.giacomo.inches.ch + 80 Alexander Gordeyev + 81 Steve Conklin www.ai4qr.com + 83 n1c0la5 + 84 Matthew R. Johnson + 86 Jeppe Rishede + 87 Kirill Zakharenko - Russian Federation + 88 beltwaybureau.com + 93 felix svoboda + 95 Smart + 96 Stephen Goudge + 97 Dr Richard Whitaker, www.drrich.co.uk, UK + 99 Tim Robertson + 101 Rudy De Volder, www.devolder.be, Belgium + 104 August H., Wien + 107 Jason Hsu + 109 dstensnes + 110 Joe Reynolds (professorlamp) + 112 Michael Davies (AU) - @butterparty @spaceduststudio + 113 Jim Kirk, Westborough, MA, USA + 114 yfnt + 117 Even when it looks like someone is reaching for blue sky. Some days you just have to blindly support that dreamer. + 118 G. Todd Vaules - todd.vaules.net + 122 Gunnar Wehrhahn + 124 Eric Masser + 126 Vaibhav Sagar + 128 Eric Wallstedt + 129 Richard G Wiater + 130 Toby Nance + 132 Michael Fogleman + 133 Snepo Research www.snepo.com Gary says Hi! + 137 nic gihl + 138 Felix Yuan + 139 mmhanif + 141 James Snyder + 144 roddyr2 + 146 Richard Jones + 147 Jon-Eric Simmons + 148 Craig "The Coder" Dunn + 150 Jesse S (USA) + 151 Matt I. - github.com/pengii23 + 153 Seth Borders - sethborders.com + 155 David Zemon (http://david.zemon.name) + 156 Garry DuBose + 157 Apeiron Systems + 158 BAR + 160 Jakob Hedman + 163 Bryan Moffatt + 165 Moises Lorenzo, Tenerife Isl. + 166 Erik H. + 170 Peter George + 171 Nikolas Akerblom + 174 Chris (@chassing) + 176 Wei-Ning Huang + 178 Edd Barrett, UK + 179 Alec Langford + 180 Shunya Sato + 181 Serge GUILLAUME + 183 Dr. Ross A Lumley + 184 Dorian Pula + 189 Tendayi Mawushe + 190 SDanziger + 191 Sean O'Donnell + 192 Kevin McLaughlin + 193 Tommy Allen + 194 Beedlebub + 195 Brad Howes + 196 Mike B + 200 Aleš Bublík + 202 David Dever + 206 Danilo Bargen, https://dbrgn.ch/ + 209 Brendan Curran-Johnson + 210 Piotr Maliński http://www.rkblog.rk.edu.pl + 211 SEE Co. - Science, Engineering and Education Co. - www.seeco.us + 215 Richard Lancaster + 218 Bilbo Baggins from Middle Zealand + 219 Ollie Guy + 221 Shlomo Zippel + 222 Andy Kenny + 223 Double-O-ren + 226 For the pleasure of @tinproject + 229 mfr + 230 Eric Floehr + 232 Matt from Adp.EU.Com + 234 Joanna Tustanowska & Wojciech Bederski + 235 Eric LeBlanc + 236 Siggy , Belgium + 238 Mauro De Giorgi + 239 Belug http://belug.ca/ + 241 Arik Baratz - @arikb + 242 Zvika Palkovich + 243 Yves Dorfsman - yves at zioup dot com + 244 Asad Ansari, Canada + 245 Brandon Bennett + 246 Christoph Bluoss + 248 Konstantin Renner + 249 Abtin Afshar + 250 A. Soltani + 251 Jon Mills + 256 NoisyGecko + 258 Lothilius + 262 Jay Deiman + 263 flo at twigs dot de + 265 _Mark_ eichin at thok dot org + 267 Adrian Astley + 268 aknerats[::-1] + 271 @robberwick + 272 Daniele Lacamera + 273 Thanks to M. Derome + 275 Paul Paradigm, Australia + 276 lyuden + 277 www.SamuelJohn.de + 279 John Pinner, funthyme at gmail dot com + 280 Michael and Vicky Twomey-Lee + 281 Kenneth Ljungqvist + 292 Karin Beitins, Australia + 295 Nick Johnson + 297 Chris Cole U.K. + 298 The planet Andete is famous for its killer edible poets. + 302 Patrick B (aged 11) + 304 Chris Mason, Australia + 306 Steven Foster + 308 Pat Fleury, Andrew Hodgson + 311 @moneywithwings + 313 Neil Stephen + 314 Cory A. Johannsen + 315 Massimo Di Stefano - geofemengineering.it - Italy + 317 James Luscher, Madison, Wisconsin, USA + 319 Lindsay Watt + 320 Nils Fischbeck + 324 Peter J. Farrell - Maestro Publishing, LLC - Minneapolis, MN, USA + 325 Alex Willmer (@moreati) + 328 T.R. Renicker + 329 William B. Phelps + 330 David Goodger + 331 Viktoriya Skoryk + 334 JR Rickerson + 336 Keven Webb + 338 www.hcfengineering.com + 341 Larry Lab Rat, Shalford. + 342 Rob Hetland + 343 Brush Technology (NZ) + 346 Jason Fehr + 347 Olivier Vigneresse + 348 Nano Gennari, me at nngn dot net, Brasilia, Brazil + 352 Petr Viktorin (http://encukou.cz) + 355 Karijn Wessing (IN2TECH) + 356 Arsham Hatambeiki + 358 Alvaro Rivera-Rei + 360 Nolan & Theo Baldwin + 362 Tyler Baker, USA + 363 Russell Warren (Canada) + 365 Aaron Peterson + 366 Al Billings + 367 Jeremy Herbert + 372 Dimitrios Bogiatzoules, www.bogiatzoules.de, Germany + 375 Paul Nicholls + 376 Robert F. Brost + 378 Aideen (Cambridge, UK) - Very happy backer and follower of this great project + 379 Caelan Borowiec + 380 Caroline, Canada - carolinesimpson.ca + 382 Rikard Anglerud + 383 Scott Will + 384 Jussi Ylanen + 385 @joshbapiste + 387 spongefile + 389 Keith Baston + 392 Holger Steinlechner + 394 sent by State mail service + 398 N.Pearce, Wells UK - @t #ashtag UK + 399 Paid up & stood back;; + 401 Mike M. Tempe, AZ, USA + 406 Brandon Jasper + 407 Dan Mahoney + 411 George Bushnell, for use in CPSS + 412 Per Konradsson + 413 Supported by afinzel + 417 Tom Igoe + 418 Jonathan Saggau + 419 Chris Allick http://chrisallick.com + 420 joshuaalbers.com + 423 B. Adryan + 432 Tim Fuchs + 433 steven antalics + 434 BezouwenR + 435 Andrew Addison + 436 Hubert de L'arrêtdubus - France + 437 Salim Fadhley + 438 Ben Hockley + 439 Geoffrey Webb + 441 Vladimir Mikulik + 442 7 Elements & Troy Benjegerdes - hozer at hozed dot org + 443 Pashakun + 444 Craig Barnes, UK + 445 Andres Ayala + 446 Stonly Baptiste (urban.us) + 448 Brian Conner + 452 Jeremy Blum (jeremyblum.com) + 454 Pebble Technology + 455 Andrew + 456 Jeffrey Allen Randorf, PE PhD + 457 J.A.Zaratiegui a.k.a. Zara + 459 simon.vc and hack.rs + 462 La vida es para vivirla y ser feliz, de esa forma damos gracias por tan gran regalo! + 463 Alistair Walsh + 469 fun, Ireland + 474 martijnthe.nl + 479 Andreas Kobara + 486 Armanda + 487 Richard Myhill + 488 Ash Gibbons + 489 Glenn Franxman HackerMojo.com + 492 Russell Durrett + 494 Pieter Ennes + 495 Tom Gross, Washington D.C. + 496 Mark Schafer + 497 Sandro Dutra, Brazil + 500 Can Bulbul + 501 Chih-Chun Chen, http://abmcet.net/Chih-Chun_Chen/home.html + 502 Lost Property Bureau Ltd + 503 skakz + 504 Chad Cooper + 505 Makhan Virdi, mlvirdi.com, InfinityXLabs.com, USA + 506 Glenn Ruben Bakke, Norway + 507 Alasdair Allan + 509 dlbrandon + 511 Dr J Garcia, Sweden + 513 Tiago Vieira + 518 Team ME + 519 OBD Solutions (http://www.obdsol.com) + 520 @pors + 521 Joo Chew Ang + 523 garbas + 526 http://epoz.org/ + 527 J. Sabater + 530 José-María Súnico + 537 Erfundnix + 538 Tontonisback Belgium + 539 Greg Benson, Professor, University of San Francisco + 542 Thomas Sarlandie aka @sarfata + 545 JanTheMan kickstarter at embedded-systems dot craftx dot biz + 546 Chuhan Frank Qin + 549 Peb R Aryan, Indonesia + 553 Johan Deimert, http://www.ldchome.org + 555 Conny Sjöblom / Finland + 558 AndyboyH, UK + 559 Anthony Lupinetti + 561 Travis Travelstead + 566 Siegfried Boyd Isidro-Cloudas + 567 G. Schroeer + 568 mmths, http://randomaccessmemory.at/ + 570 Andy Miller - NZ.. + 571 Rodolfo Lara from México + 572 Gary Patton Wolfe + 574 Vend-lab Russia + 578 Super Job! FXF + 579 Oliver Heggelbacher, www.kickdrive.de + 581 James Husum + 585 David Lodge + 587 Tess + 592 PR Taylor + 593 6306665119 + 598 Jorg Bliesener, Brazil - www.bliesener.com + 602 Rodrigo, Germany + 605 Tanja Kaiser, www.mrsminirobot.de, Germany + 606 Franco Ponticelli - www.weblob.net + 608 Piet Hoffman + 609 Paul Cunnane + 610 Balazs Kinszler + 611 Nathan Ramella (synthesizerpatel) + 612 Tyler Jones (squirly) + 613 James Saffery + 614 Christoffer Sjowall + 615 Iman Shames + 616 Thomas Dejanovic, Australia. + 618 Tom Alker + 619 Matt Davis, UK + 621 Design for the real world! @UXnightingale + 622 Budd Van Lines + 624 __Gio__ + 628 Chew Kok Hoor + 630 Santiago Alarcon, Thanks Damien for Micro Python + 632 hardtoneselector + 633 supported by Chris Bunker + 634 Sebus - France + 635 Mechanical Men Sweden + 638 A Fellow Electronics Enthusiast + 639 Stan Seibert + 642 Dave Curtis + 652 Sebastian Ross - www.ross.sx + 653 Julien Goodwin + 654 Reinoud de Lange, the Netherlands + 655 carl beck + 659 John Gaidimas + 660 Tyler Eckwright + 661 Keith Rome (Wintellect - http://www.wintellect.com/blogs/krome) + 662 Kashev Dalmia - kashevdalmia.com + 666 Alberto Martín de la Torre + 667 Niels Kjøller Hansen + 668 pmst - Italy + 671 Sergio Conde Gómez (skgsergio) + 672 Micromint, www.micromint.com + 673 Xie Yanbo, China + 675 Thank you + 677 Kacem Ben Dhiab + 679 CornishSteve + 680 Daniel Wood, Warrington, UK. + 682 Greg "GothAck" Miell + 688 Matt Williams & Sam Carter + 691 Frédéric Lasnier + 694 Tim K + 697 Joshua Clarke, Guernsey! + 700 daynewaterlow.com + 703 Scott Winder + 704 @DepletionMode + 707 Maria Yablonina + 710 Roger Hausermann + 713 Crazy_Owl + 714 mike hardin usa + 717 C. Towne Springer + 719 ursm gruesst euch + 720 madnis + 727 http://itay.bazoo.org + 729 @0atman + 730 Jerry Gagnon + 732 Emmanuel Boyer + 738 suspenders + 739 Roland Frédéric - http://www.creativeconvergence.be/ + 742 @herchu + 745 Riley Lundquist + 746 Go LOBOS + 749 João Alves, http://jpralves.net, Portugal + 751 Nick Porcino + 753 Jack E. Wilkinson, Texas, USA + 754 @rcarmo on Twitter/Github + 758 Matt Manuel, www.mattmanuel.com + 759 Padraic D. Hallinan + 760 Rob Fairbairn + 763 Zac Luzader + 768 Sam Shams + 773 terje nagel, dk + 775 Luc LEGER + 782 Luis M. Morales S. + 785 Charles Edward Pax + 786 Daryl Cumbo + 787 Zephyris13 + 788 Wonderful project. + 792 Sylvain Maziere + 794 Milen + 795 Robert Mai, Germany, hsapps.com + 797 Angelo Compagnucci angelo.compagnucci at gmail dot com + 801 Long Live Micro Python, airtripper.com + 804 António M P Mendes + 805 Marc Z. + 809 Anoyomouse + 810 in memory of Dan J. Schlacks III + 817 Peter Froehlich - http://werk-schau.blogspot.com + 818 Ahmad Albaqsami + 821 Peter Lavelle (http://solderintheveins.co.uk) + 822 Manuel Sagra de Diego http://manuelsagra.com/ + 823 Sam Wilson + 824 Khalis + 825 c't Hacks + 828 Georg Bremer + 830 Ward en Sanne (WenS) + 832 javacasm http://www.elcacharreo.com Spain + 833 mctouch + 835 Bruce Schreiner @ www.stevenscollege.edu/electronics + 836 Jonas + 839 Nick Ludlam + 840 Patrick_Law, UK + 843 Alex Crouzen, UK + 848 Ben Banfield-Zanin + 850 Wouter Slegers, Your Creative Solutions + 851 Fred Zyda + 853 Gianfranco Risaliti + 854 Ron Hochsprung + 858 Vianney Tran + 862 Aaron Mahler - http://halfpress.com + 868 Stephan Schulte, Germany + 869 Kenneth Henderick + 872 DaveP (www.davepeake.com) + 873 Markus Schuss, Austria + 876 Kyle Gordon, http://lodge.glasgownet.com + 877 Joseph Gerard Campbell + 881 Thanks for the board. Good luck to you. --Jason Doege + 883 Garet McKinley + 884 www.magtouchelectronics.co.za + 889 Ben Johnson + 896 Ruairi Newman + 897 Gemma Hentsch + 902 Alexander Steppke + 906 Stephen Paulger + 907 Martin Buhr, http://lonelycode.com, UK + 912 Dale Drummond + 913 Go Utah State + 918 Jarturomartinez, Mexico + 921 Barry Bourne Micro Python Supporter + 923 Andreas Bolka + 927 Thanks Susan, Tom, Paul, and Mark! + 935 http://wall-y.fr + 937 Eero af Heurlin, Finland, https://github.com/rambo/ + 938 Guillaume DAVY + 941 Alexander Steffen + 942 Janne "Lietu" Enberg + 945 Luca 'loop' de Marinis - https://github.com/loop23 + 946 Andras Veres-Szentkiralyi http://techblog.vsza.hu/ + 948 Florian flowolf Klien (http://blog.flo.cx) + 949 nickyb + 951 Mark Walland, England + 952 Ian Barfield + 953 Andrew Murray, UK - eat my code - http://links.bloater.org/micropython + 955 Kyle Howells + 956 Chris Cadonic + 957 LCS, USA: scripting___/||\===/||\___embedded + 958 Sven Wegener + 963 Kean Electronics http://www.kean.com.au/ + 964 Beandob + 965 Don't feed the troll. + 966 Alexis Polti (http://rose.eu.org) + 969 Scottyler + 971 The Dead's Own Jones + 974 Evseev Alexey + 976 Arnaud + 978 Jannis Rosenbaum + 980 paul at fontenworks dot com + 981 John Griessen ecosensory.com USA + 982 Tobias Ammann + 983 Simon V. + 984 JaWi + 987 Ergun Kucukkose + 989 Jonathan Piat France + 990 Steve Pemberton + 993 Aaron Robson + 994 Antoine Authier + 995 Thomas Winkler, Austria + 997 Jannes mit dem dicken Pannes + 1001 Joe Baker + 1002 Jon Hylands, Canada (blog.huv.com) + 1004 Mike Asker (aka mpymike) + 1007 Charles V Bock - Charles at CharlesBock dot com + 1010 Remember June 4th, 1989 + 1012 Stuart Marsden + 1013 Herbert Graef, Stuttgart + 1014 Arthur P, USA + 1015 John Hall & Jeremy Armijo + 1017 Luciano Ramalho, Python.pro.br + 1018 Quentin Stafford-Fraser + 1019 Marcin Walendzik Ratingpedia.eu + 1020 Wincent Balin + 1022 rbp + 1024 Frank Carver ( www.frankcarver.me ) + 1026 Peter Farmer, http://geekytronics.com/ + 1029 Rubens Altimari + 1033 Sebastian + 1035 Gerli, Estonia + 1036 Maurin, Switzerland + 1037 Kevin Houlihan (http://crimsoncookie.com) + 1039 Jon Green of Adeptium Consulting (www.adeptium.com) + 1040 Eirik S. Mikkelsen + 1042 Jogy Sam + 1043 GGG + 1045 Sean E Palmer, epimetheon.com + 1049 Greg O'Drobinak, USA + 1050 RaptorBird Robotics Inc + 1051 Desmond Larsen-Rosner + 1056 Crusty + 1057 ArthurGuy.co.uk + 1059 Melissa-Ivan, 14/04/2013 + 1064 Enrico Spinielli, https://github.com/espinielli + 1066 Dave Snowdon + 1067 Martin P. Hellwig + 1070 Carl Clement + 1074 Paul Taylor + 1076 Pandemon + 1082 Thrilled to support Damien's effort to put this together: there will no doubt be many applications for this effort and many enhancements and ports.. + 1083 Oddvar Lovaas + 1090 BenScarb + 1093 Www.qualnetics.com + 1094 Manny Muro - Now Python can RULE from below as it does from above! PYTHON RULES!!! :) + 1095 Michael Grazebrook + 1098 Mark Shuttleworth, UK + 1106 wyzzar + 1110 Luca Zanetti + 1112 Carl A Fagg + 1115 Adam Klotblixt + 1118 Breawn + 1122 pippyisatruck + 1124 Andrew "ClothBot" Plumb + 1126 Realise the projects your heart beats for! Sven Wiebus (http://wiebus.tumblr.com) + 1128 Citius Systems + 1130 Benjamin & Reuben Fuller + 1131 aglimme + 1133 John Becker + 1135 Mark Drummond + 1138 JHProuty + 1141 Lars Olsson Sweden + 1144 daisuke, http://dkpyn.com + 1145 Chris Pawley - http://www.pawley.co.uk/honey/ + 1147 Daniel from EzSBC.com + 1149 New York Mortgage Exchange NYME.COM + 1150 Herb Winters,USA,www.ecs87.com + 1151 renttu + 1159 Joe Rickerby + 1160 john guthrie + 1161 PUBLIC + 1163 dobra-dobra + 1164 Neil Reynolds, Staffordshire + 1165 GEHoward + 1166 Frank Delporte + 1167 Bauer Brauner Enterprise + 1168 Francisco Mardones + 1169 Ryan Kirkpatrick, @rkirkpatnet, http://rkirkpat.net/ + 1170 Krister Svanlund + 1174 Derek Patton Pearcy + 1177 Roger Olsson, Sweden + 1179 Jan-Niklas Braak + 1180 Pete boy + 1181 MilenX + 1182 Ubbe Larsson + 1183 Simon Freethy + 1184 Daniel Andersson + 1187 Daniele Procida + 1190 Adrian Duke + 1191 Pauline Middelink + 1193 Ted Gueniche + 1197 Craig Knott, University of Queensland, Australia + 1198 Jamie Mackenzie - Australia + 1199 ravenoak + 1200 LucaP Luni Italy + 1203 jacanterbury + 1205 Bleachin, www.rhyspowell.com + 1207 Supported by Andrew Maier via Kickstarter + 1208 Rob, http://robjstanley.me.uk + 1210 George Gingell + 1213 Chris Elleman + 1215 Jack Barham - @jackbarham - http://jackbarham.com + 1221 Kyle Dausin + 1222 Ben Lucker + 1225 Gareth cheesewhisk Evans + 1226 Jacob Forsyth + 1227 Olof S - Germany + 1231 Brasil + 1233 glaslos + 1234 Will Cooke - http://www.whizzy.org + 1236 Andrew Wright - Canada + 1239 Resourceful Robin + 1240 Jay O'Neill @jayoneilluk + 1241 Dennis G Daniels + 1244 J. Peterson (www.saccade.com) + 1245 Chipaca + 1246 Nicko van Someren + 1247 C. Cumbaa, Canada + 1248 Gyro Gearloose was here + 1249 Magnus Ericmats, Sweden + 1253 Steve Wilson + 1256 Adrian Bullock + 1258 Sarevian & Longwall + 1261 Skipp Savage + 1265 Eric Nahon + 1267 Stuart Dallas / 3ft9 Ltd + 1270 USA + 1271 Oliver + 1277 jeffmcneill.com + 1278 alnjxn + 1283 Marc Liyanage + 1285 Christian Lange + 1286 Bryant Paul Umali from the Philippines + 1290 W.B.Hill, Norwich, UK + 1292 Michael Karliner + 1293 Oli Larkin + 1303 A. Pockberger + 1304 dc - bagel + 1305 Thadeus Arnel + 1308 technoweenie + 1309 Liam Welsh + 1313 Per Thorell, Sweden + 1314 peterlee + 1316 Dustin Mierau + 1317 tech-zen.tv + 1320 Cheers from IDF :) + 1322 www.a-d-k.de + 1323 rixx + 1324 @jlev + 1325 e2e4 + 1328 Thomas J. Quinlan, London UK + 1329 Don Bone + 1331 Narayanamurthi + 1333 PGS_Astra-ProjeX_Wilts + 1337 Mark Schulz & Phillip Long, CEIT, The University of Queensland + 1340 Tiegeng (Tim) Ren + 1344 EMR_1344, DE + 1348 Matt Ward, Nottingham + 1351 Rupert + 1352 Cory Li - http://cory.li + 1354 Jim Davies, Brighton, UK + 1355 Jon Watkins, UK + 1356 Thomas, www.bitmix.de + 1359 Markus Gritsch + 1362 Carl H. Blomqvist + 1371 Brian Green + 1374 Ben Merryman + 1375 O'Dea + 1376 Josh Trujillo + 1378 Daniel Halloran + 1379 another_martin + 1383 Thanks for innovating! + 1385 CoderDojo Malahide + 1397 Jacob Z + 1398 Staffan Hillberg + 1399 http://kim.ht + 1402 Can't wait to plug it in! + 1403 Márton Szinovszki + 1405 sellorm says 'Hi!' + 1406 Thomas Provoost + 1411 Clive Freeman + 1412 Norman Thomas + 1415 Javier Llopis + 1417 Ho Man Fai + 1418 Anders Helland + 1421 Richard lavanture + 1425 Alan Churley, UK + 1426 Robert'); DROP TABLE Students;--unicode is fun! + 1427 Go Illini! + 1430 MicroPy FTW + 1431 Bryan Morrissey, www.browninnovations.com + 1436 Krzysztof Chomski, Poland + 1437 WellAware (USA) + 1441 Tomas Hau + 1443 Paul Way + 1444 Benjamin Anderson + 1445 Andrew Bates + 1446 Davide Di Blasi + 1451 Mathias Fischer + 1453 Drexore, NL + 1454 Marek Mroz + 1455 Mark Easley Jr. - USA + 1457 Joshua Warren + 1459 Rohan Menon + 1460 Paul Sokolovsky + 1461 Chris Foresman, @foresmac + 1475 USI + 1478 Chris Emerson + 1479 Ph. Truillet, France, http://www.irit.fr/~Philippe.Truillet + 1480 WAB3 + 1481 Lucidologia.pl + 1482 Ed Hardebeck | www.hardebeck.us + 1484 Ludovic Léau-Mercier, www.coriolys.org, France + 1487 BLUEBOBO + 1488 Berno Kneer, Germany + 1491 Julian Eccli + 1494 Batman + 1495 Manuel Núñez Sánchez + 1496 Millie and Sadie Smith + 1499 Ronald Eddy + 1500 SynShop Las Vegas + 1503 This is really cool. - Jack Conway + 1505 Victor Suarez, Argentina + 1507 Renesas Electronics America + 1509 Team + 1513 A. Lamborn KD0ZFY + 1514 olifink + 1520 mike at sustainable-opportunities dot com + 1521 luis almeida, Teresina - Brazil + 1523 Muhammad Jamaludin + 1524 Sdlion + 1525 Charles Rogers + 1526 Diego M. Aires, Brazil + 1529 muwatt.com + 1532 Proud supporter of microPython + 1535 Jesus J. de Felipe + 1536 slminneman.com -- Wow, an acknowledgement? ...really? + 1538 Mike (Meski) Smith + 1541 Piero Steinger + 1545 Alex Rembish (https://rembish.org) + 1551 Sergey [BuG2BuG] Sobko, Russia + 1553 Serge Krier + 1556 Luuk Derksen + 1561 Jimmy Caille (CH) + 1562 Jesús Leganés Combarro "piranna" + 1564 Viacheslav Olegovich Savitskiy + 1565 Jamie Whitehorn + 1567 Bagge Carlson + 1568 Milan Cermak + 1569 Matthias Lemp + 1570 BOFG + 1571 Johan Elmerfjord, Sweden + 1573 Matt Finch • fnch.io + 1574 Jean-Francois Paris + 1575 Florian Franzen, Germany + 1576 doganowscy.com + 1579 Stan Yamane + 1580 William Cirillo + 1583 David Dibben + 1584 Nicolás, Amelia, Luli y alecu + 1586 Alex W + 1591 Livia Maria Dias Tavares + 1593 d freymann chicago il & his australian shepherd jaldi + 1594 Barnstorm Studio, LLC + 1595 Sashi Penta + 1597 tflhyl + 1598 clacktronics + 1599 j3hyde + 1600 Rik Williams + 1602 Valeriy Van, Ukraine, w7software.com + 1603 Louis Taylor - https://github.com/kragniz + 1606 What's the derivative of (6.022 x 10^23)x? That's A(n)mol + 1611 Bailey & Brayden Yoong Policarpio + 1613 William Bettridge-Radford + 1617 Urbane Jackson + 1618 Henius + 1622 Alister Galpin, New Zealand + 1623 Marco Bertoldi + 1627 Julian Pistorius + 1628 www.neotral.com + 1632 ChrisB + 1633 Norbini + 1634 Eric Rand at Brownhatsecurity.com + 1636 Benjamin Eberle + 1637 MG Projects bvba, Geert Maertens, Belgium + 1640 Robson dos Santos França (Brasil) + 1642 Udine + 1643 Simon Critchley + 1644 Sven Haiges, Germany + 1646 "silicium" ("silicium_one", if "silicium" is busy) + 1648 Andy O'Malia, @andyomalia + 1650 RedCamelApps.com + 1652 Christoph Heer + 1653 AlisonW + 1654 Yannick Allard (Belgium) supported this project. + 1655 Andy Pointon, UK + 1660 Diego Cantalapiedra + 1664 Pepillou + 1670 Sonny Cannon + 1671 Rick W + 1672 David Chan, USA + 1674 Philip Rowlands + 1675 dieresys + 1676 T.R. Fullhart + 1683 Oleg Sidorkin + 1686 Tatsuro Yasukawa + 1687 Brad Smith, Somerville MA, USA + 1688 kristoffervikhansen.com + 1690 Nice Project de W6AKB Alan Biocca + 1691 Hiss Hisss Hissss Hiss Hiss Hissssssss + 1692 Alan Kennedy + 1698 ElChessu + 1701 Flower Craswell + 1702 David Fontenot + 1707 To innovation & creativity. Tony J Winter + 1708 Joakim Hentula + 1711 Michael Schaefer + 1713 Brody Radford ~ www.brodyradford.com + 1714 Charles Durrant + 1715 Rodrigo S. + 1718 Dima Shylo + 1719 Jiahao James Jian + 1722 Helen Wilson, Christ's Hospital + 1726 Martin Aule, http://hackest.org/ + 1727 İsmail Etem Tezcan, Rasteda + 1728 Charlie "Blackfrog" Sizer + 1729 Matloob Qureshi + 1730 Travis Saul http://travissaul.com + 1731 Michael Cavins + 1733 Peter Köllensperger, Norway + 1734 Anne Harrison + 1736 Peter Bradeen + 1739 Fredrik Luthander + 1740 Nick LaRosa + 1744 Aladuino + 1745 dgrebb + 1746 Truls Unstad + 1748 Jesus Saves + 1750 Andy Stannard (@rockmonkey) + 1751 Daniel Atkinson + 1755 John Potter + 1758 Ian V + 1760 David Leinbach + 1761 nemec-automation.com + 1765 Supported by JoW with Hardwired TCP/IP from www.WIZnet.eu + 1767 misskniss, Boise Idaho. It is our responsibility to code the freedom we want to see in the world. + 1768 Jeff Vahue - Knowlogic Software Corp. + 1769 Pat Molloy + 1770 Greg Maxwell gregmaxwell-at-mac-dot-com + 1771 Rich Robinson + 1773 Ken Corey @ flippinbits.com + 1782 Acknowledged + 1785 Optimized Tomfoolery + 1791 Nontakan Nuntachit, Thailand + 1794 Rasit Eskicioglu - Canada + 1795 Simon Elliston Ball + 1796 pfh + 1798 John W. C. McNabb + 1799 Frank Sanborn + 1803 Morgan Hough + 1804 Sorcha Bowler + 1805 http://www.WayneKeenan.info + 1806 HBEE, hbee.eu + 1807 Deadlight + 1809 www.danenet.org + 1811 Sergey Nebolsin + 1813 Threv + 1817 dynsne + 1818 David Wright + 1819 John Warren + 1821 I wanted Erlang! (╯°□°)╯︵ ┻━┻ + 1825 Howard R Hansen + 1828 Kevin Schumacher + 1833 Matthias Erll, Sweden + 1836 Matt Graham + 1837 thedawn + 1838 Ruby Feinstein + 1839 Gustavo Muñoz (timbergus) + 1840 Ian Paczek + 1841 Köteles Károly, Hungary + 1843 Tobias Sette Ferreira + 1846 x4FF3 <3 microPython + 1847 Enrico Faulhaber (Germany) + 1850 jolan00 + 1854 Red Harbinger Inc + 1855 Noman + 1858 @DerLinkshaender + 1863 Jon Woodcock + 1864 Elmo, hakkerikartano.fi + 1865 Imaginals + 1866 Sam Hathaway and Rachel Stevens + 1874 Remo Sanges, SZN, Italy + 1875 Devraj Mukherjee + 1876 an Embedded fan + 1877 Peter Huisers + 1878 Kin-Wai Lee (Malaysia) + 1879 Samuel Hawksby-Robinson + 1881 R. Stock + 1886 Randy of Capistrano street backed Damien's MicroPython! + 1887 Rogério Bulha Siqueira - www.esd-talk.com - Brazil + 1889 NickE is happy to support such a worthy project! + 1892 John Boudreaux + 1894 Riverfreeloader + 1895 Jose Marcelino http://metavurt.net + 1896 T Britto-Borges + 1899 DannyWhitsonUSA + 1904 José Iván Ferrer Ruiz. + 1905 Tom Loredo + 1906 Gregory Perry USA + 1908 josephoberholtzer.com + 1910 Michael Klos, USA + 1912 Adam Mildenberger + 1913 R Anderson + 1914 Nikesh, USA + 1915 Bogdan Chivoiu, Romania + 1916 Scott C. Lemon, USA + 1918 Konstantin Ufimtsev (@KestL) + 1919 Benny Khoo + 1922 Nicci Tofts + 1925 Joshua Coxwell + 1926 Franklin Hamilton + 1928 Peter Korcz + 1929 Leroy Douglas + 1930 A ナルと fan from Nigeria who likes smileys, here's one for good measure :) + 1931 Kimmo Lahtinen, Finland + 1932 http://staybles.co.uk + 1937 The Olivetti's: Emanuele Laura Nausicaa Sibilla Ettore + 1940 Pascal Hirsch + 1942 cbernander, Sweden + 1944 Enrico M. + 1947 Dinis Cruz + 1949 Jonathan Greig, http://embroidermodder.github.io + 1950 Andy Bower + 1952 Gerard Hickey + 1953 Fabrice BARRAL was here ... + 1955 Pieter Röhling + 1957 uomorando, Italy + 1959 Acacio Cruz + +The MicroPython project raised further funds through a second +Kickstarter campaign that was primarily targeted at porting the +code to the ESP8266 WiFi chip. The campaign ended on 2nd March +2016 and gained the support of 1384 fantastic backers who believed +in the project and the principles of Open Source code. Those +backers who asked to be named are listed below, with an asterisk +indicating that they also supported the first campaign. + +* 1 Gabriel, Seattle +* 2 @robberwick +* 6 Dave Hylands + 7 Les, UK + 8 Ryanteck LTD., UK + 10 karlsruhe, HU +* 11 Turbinenreiter + 13 Ben Nuttall, UK +* 14 Bryan Morrissey, MA, USA +* 15 Jogy, Qatar +* 16 BOB63,IT + 19 ReaBoyd +* 20 Andrew, MK +* 21 chrisq, NO + 22 Pascal RENOU, France + 23 Javier G, ES + 25 Forrest, US + 26 Filip Korling, Sweden + 27 roberthh - Rhineland +* 28 Herbert Graef, Stuttgart, thanking the MicroPython Team for this great project +* 29 johnsonfamily38, UK + 30 CympleCy + 31 OJ, PK + 32 Daniel, SVK + 33 Shabaz Mohammad +* 35 Kenneth Henderick, BE +* 37 Daniel Mouritzen, DK + 39 Torntrousers, UK +* 44 Scanner + 45 Radomir Dopieralski + 46 Nick, UK +* 47 Jon Hylands, Canada +* 48 Ben Barwise Clacktronics + 50 Rob Kent, UK + 52 Carlos Pereira Atencio + 54 Andy, UK +* 55 WMinarik, Canada + 57 Hauffe, Germany + 58 HyperTaz, IT +* 61 Michael Kovacs, AT + 62 Erick Navarro, PE + 69 Karan,US +* 71 Nick B, UK +* 72 Anthony Lister, NZ +* 73 Bryan Lyon + 76 Miguel Angel Ajo, ES +* 78 Sebastian, Regensburg (GER) +* 80 iv3unm + 81 Thierry BÉNET, FR + 84 Jannis, Germany + 86 Nathan Jeffrey + 88 Cory Benfield, UK + 90 Carlo, IT +* 91 Wojciech Bederski (@wuub) + 92 Steve Holden, UK + 93 Tristan Roddis, UK + 94 Balder, Sweden +* 95 Rhys, UK + 96 Rowan, UK +* 97 Gary Martin, Edinburgh +* 100 Mikael Eiman +* 101 torwag +* 102 Craig Barnes, UK + 103 Andrea Grandi, UK + 105 Piers, UK +* 109 Wayne Keenan + 110 makuk66 + 111 Hamine,DZ + 112 Arahavica,JP +* 113 Bill Eubanks, USA + 114 Jonathan, UK + 115 ghickman +* 117 Christian Lange, Germany + 119 Jonty Wareing + 121 TheHetman + 123 Víctor R. Ruiz, Spain +* 124 Laurynas Paukste, Norway +* 125 Taki + 126 André Milette, Canada +* 127 Ron Cromberge,NL + 128 IJ, Thailand +* 130 IGOR VIZIR + 132 Bill Saturno + 134 scibi + 136 Timbo, AU + 137 Raphael Vogel, DE +* 139 jasonkirk, US + 141 Linköping, Sweden +* 142 Dugres + 144 DarioS, UK + 146 NelisW +* 148 _Mark_ +* 149 Folke Berglund, Sweden + 150 Deniz Dag/Belgium + 152 Jacques Thomas + 153 Dag Henrik, Norway +* 154 Alexander Steppke + 158 stavros.io +* 161 Seong-Woo Kim, KR + 162 Aaron H, Seattle + 164 Iwan, CZ + 165 Jenning, DE + 167 Oliver Z, Germany +* 168 Chris Mason, Australia + 169 Fabio P. Italy + 171 Jonathan, Ireland + 173 Philipp B., DE + 174 Mancho, IT + 175 Mikkel Sørensen, DK + 176 Raphael Lullis +* 177 Tim, China + 179 JasperS, NL + 180 Scott, AU + 181 Roland Kay, UK + 182 Adam Baxter + 184 Hugo Herter + 185 Simon AM, Malta + 186 Leif Denby + 190 Maxious +* 192 Guido, GER +* 193 Pierre Rousseau, Canada + 195 Pete Hinch +* 198 KoalaBear,USA. TRUMPED 2016! +* 200 Pimoroni, UK + 201 jpwsutton, UK + 203 Felix, Sweden + 204 Dmitri Don, Tallinn Estonia + 205 PeteDemiSwede, UK +* 207 Serge GUILLAUME + 208 Gurtubay, ES + 209 Geir-Olav, NO + 210 RayDeo, Germany + 215 DIYAbility + 216 Josef Dunbar, USA +* 217 Enrico, BE/IT + 219 Damian Moore, UK + 220 Wayne and Layne, LLC + 221 The Old Crow, USA + 224 Hackscribble, UK +* 225 Alex March, UK + 226 @rdslw + 227 Mike, Canada +* 228 Adrian Smith + 229 Dinu Gherman, Germany + 230 Tinamous.com +* 231 Nikesh, US +* 232 chrisallick.com + 234 Daniel Von Fange +* 235 Michal Muhlpachr, CZ +* 236 Petr Viktorin + 237 Ryan Aldredge + 238 Patrik Wallström, SE +* 239 MobiusNexus + 240 Stray, US +* 241 BOFG, no + 244 Issac Kelly +* 247 David Prime + 249 James Marsh, UK +* 250 BezouwenR + 252 Avinash Magdum, India + 253 Greg Abbas, Menlo Park CA + 254 Jorge, ES + 256 JohanP, swe +* 258 Ben Doan + 259 Jan van Haarst, NL +* 263 JoshT, Los Angeles + 264 cstuder, Switzerland + 266 Jon Armani +* 270 Liam Welsh + 271 Jason Peacock + 272 Alejandro Lopez + 275 Dan O'Donovan, UK + 276 N1TWC + 277 Roland Tanglao, Vancouver + 278 Twpsyn + 280 Robert, ME-US +* 282 Thomas, UK + 283 Jeff Schroeder, USA + 284 Paulus Schoutsen +* 287 Neon22, NZ + 290 kbmeister + 291 Gary Hahn + 292 Dave Matsumoto, USA + 296 Sam Lee, SG + 304 Poul Borg, Denmark + 307 MightyPork + 308 Dale +* 312 Anton Kraft, Germany + 315 Kism3t, UK + 317 NateM +* 318 N&T, Calvijn Meerpaal, NL + 322 Andreas Monitzer + 323 Rikard, SE + 328 Olaf, DE +* 329 John Boudreaux + 330 DOCE, Germany + 331 feilipu + 332 Stefan Schwetschke + 333 Wayneji, NZ + 337 Alain de Lamirande, Canada + 338 Hori, TW + 340 Azmodie, UK + 341 Lygon, UK +* 342 JRM in STL, USA + 344 R Colistete-Jr., BR +* 345 ChristianG, DE + 347 Nis Sarup, DK. + 350 Nickedynick + 351 Dazza, Oz + 352 lispmeister, NL + 355 Tomas Lubkowitz, SE + 357 Mark, UK +* 358 Team ME + 363 Papahabla + 364 Greg Chevalley + 365 Maic Striepe, Germany + 369 Ian McMahon + 371 A. DARGA, Fr + 372 Ernesto Maranesi, BR + 373 Steve Lyon + 374 James Cloos + 375 Bas Zeppenfeldt, The Netherlands + 378 Pycom Ltd + 380 Wade Christensen, USA + 382 Justin Wing Chung Hui, UK + 383 C Paulson + 384 Ian Tickle + 386 Danny, Seattle + 388 Erik Moe, Chicago, IL +* 389 Eric B. Wertz, USA + 390 Michael. CH + 391 Christopher Baughman + 392 James Churchill + 393 Rob, DC + 395 Whee Min, Singapore +* 396 Jason Doege, TX + 401 MrFish + 403 Thejesh GN + 404 Markus, Sweden + 405 AMR, Spain + 407 Svet, ES +* 408 Thoralt, Germany + 409 Emil, Sweden + 410 David Moloney, ireland + 411 Marco S, DE + 415 Peter W., Austria + 417 emendo A/S +* 419 Kalestis, Switzerland + 421 Ondra, CZ + 422 Elheffe + 423 thinkl33t, UK + 424 TonyF + 425 Herr Robert Linder, PA, USA +* 426 Anders Astrom S(E|G) +* 428 Jussi Ylanen, CT, USA + 431 Neil H., USA + 434 Rod Perez, MX + 435 Carol, US + 436 Gina Haeussge, DE + 438 Weilinger, GER +* 439 Ron Ward, Australia + 441 Rex, UT, USA +* 444 Slush, CZ + 445 Bruce, Florida +* 448 Patrick Di Justo + 449 ScubaBearLA + 450 Mike Causer, Sydney AU + 451 Joel Fries, USA +* 452 Andrew Bernstein, US + 454 EAS, Seattle, WA, USA +* 456 Christopher J. Morrone, USA +* 457 Anthony Gilley, Sweden + 458 Andre Breiler, DE +* 460 Fuffkin, UK +* 461 adent, CZ + 462 Samuel Pickard + 463 Mirko, Germany +* 464 Ramin/US + 465 Mike, Grenoble + 466 Rolf, DE +* 467 Dave Haynes +* 469 Mac Ha, Vietnam +* 470 Enno, DE +* 473 Smudo, DE +* 474 Duncan, Scotland + 475 Chris, UK + 476 Peter Groen, NL + 478 Gertjan Geerling, Nijmegen +* 479 Benjamin Eberle +* 480 Mechanical Men Sweden +* 482 Rémi de Chazelles, FR + 483 mager, Bremen + 484 jurekh, NL +* 485 Craig Burkhead + 487 JohanHartman, SouthAfrica +* 489 Viktor, NL + 491 Jean-Denis Carre + 492 Jesse, Canada + 493 Alex C. MacDonald, USA +* 494 GustavoV, MX + 495 Sebastian, Berlin + 497 Bernard, Feluy +* 500 Ron H, USA + 501 Gregg "Cabe" Bond, UK + 502 Colin, NI + 504 Robin, USA +* 507 pkropf +* 510 6LhasaCo Canada + 511 Tom Sepe, USA + 513 Andrew McKenna + 515 tom46037 + 516 G2, USA +* 517 Pauline Middelink, NL +* 518 Brush Technology, Ltd + 520 Pierre Meyitang, USA + 521 Stephanie Maks, Canada + 526 John McClain +* 527 Sigadore, US + 528 Richard Hudspeth, US + 530 Martin, Austria + 531 Stephen Eaton, Australia +* 533 RJCE, UK + 535 Teiste, Finland + 536 Pio, UK + 537 DirtyHarry, DE +* 540 Dom G. UK +* 541 Nial, UK + 543 Andreas, AUT + 545 WisdomWolf +* 549 MrMx,ES + 552 Daniel Soto, Landscape. + 554 Claus Fischer, DK + 557 Aleksi Määttä + 560 Justin Wilcott, USA + 562 LoneTone, UK + 567 Cameron, US + 568 Dirck, Germany + 569 Michael Keirnan + 571 Harry, CN +* 572 Ward Wouts + 573 Dan Anaya, USA + 574 Ben Bennett + 575 nirvana2165, US + 576 PDG, BZH +* 581 Visit, Thailand + 582 John Carr, UK +* 583 Klankschap + 587 jacky,FR + 588 JD Marsters + 591 Ryan Jarvis, US + 595 Claudio Hediger, CH +* 597 Bambam, Sweden + 598 Timothé, FR +* 599 Luís Manuel, Portugal + 601 Eric, DE + 602 Olaf, Cambridge, UK +* 603 Tim, Dubai + 604 Tyndell, US + 606 Ciellt AB, SE + 607 Ömer Boratav + 609 Guy Molinari, US + 614 Freek Dijkstra + 615 Carlos Camargo CO + 616 Michael Nemecky, Norway + 618 Ovidiu G. + 619 arobg, USA +* 621 Geoff Shilling, US + 623 EliotB, NZ + 624 slos UK + 625 Montreal, CA +* 626 Peter Korcz + 627 Kodi + 628 Jim, Valdosta, USA + 629 Sander Boele, NL + 630 Max Lupo + 631 Daniel.B, Newcastle Australia + 632 Andrés Suárez García, Vigo (Spain) + 633 Rens, NL + 634 Max Petrich, DE + 635 Fabian Affolter, CH + 636 Cadair +* 637 Mike Karliner + 638 Daniel T, UK + 639 Mark Campbell, UK + 640 James S, Australia + 641 PBTX! +* 642 amaza,SP + 644 se4mus +* 645 Alexander Steffen +* 647 Jim Richards Maine, USA + 649 Doug D, US + 650 Keaton Walker +* 651 Scott Winder, USA + 653 Jeff Fischer, USA + 654 Andrej Mosat + 655 Mohd Faizal Mansor, Malaysia + 657 Mike "Cutter" Shievitz, US +* 658 Daniel Andersson, SE + 659 Alexander, NL + 660 François, CH +* 661 AndrewS, UK + 662 Denisae, PT + 663 KC8KZN + 664 Angelo, Wales + 665 BlueberryE, Germany + 667 fvlmurat + 668 Adam Wilson + 675 Ulrich Norbisrath (http://ulno.net) + 676 Daniel, Portland OR +* 677 Andreas Lindquist, SE + 680 Jason, NL + 682 lapawa, GER + 683 John Batty, UK + 685 Addy, Netherlands + 686 Marc, CA + 690 APapantonatos + 691 gmorell, US +* 692 Jamie Mackenzie, Adelaide, SA +* 693 Dave Dean, US + 697 woojay, US + 698 Webabot, NY +* 699 Jason Fehr, Canada + 700 Hadi (AU) +* 701 Abraham Arce +* 703 Must Be Art + 712 Thanks for the great work!/datax-holding/Stuttgart +* 714 Thomas Pr., BE + 715 Black Country Atelier BCA + 718 Don W, Arlington VA + 721 Xavier C. (EU) + 722 Chad P. Lung, U.S.A + 726 Alexander Lash (@lexlash) + 727 Sven, MX + 728 Terence, PL +* 730 Mauro De Giorgi, USA + 735 Jay Ward, Canada + 736 Fabian Topfstedt, AT + 739 sjoerdDOTcom + 740 David, Australia + 743 Michael Niewiera, Germany + 745 cbenhagen + 746 berserck, CH + 748 Lars Hansson, Sweden + 750 Landrash + 751 Richard B., CT USA + 752 Neil Chandler, UK +* 753 John Griessen US +* 755 Caminiti, Mexico + 757 Mikael Trieb, Sweden + 760 S1GM9, MX + 761 Dave C, US +* 763 Su Zhou, China + 765 Caitlyn - USA + 769 Will, NZ + 770 CJB,UK + 771 Victor Claessen, NL + 772 Antal, CH + 773 Tokyo, Japan +* 774 Join Business & Technology AB, Sweden + 777 Overspeed Innovation +* 778 Bruce, Chanute KS + 779 TOPALIS, RO + 780 klaas2 + 781 Matthias Schmitz, Berlin + 783 Jan Studený wishes "Python everywhere" + 788 Ian, USA + 789 Mark K, UK + 791 DerFlob, Germany + 792 Staffan Johansson, Sweden + 793 Stefan W., DE + 795 Mark S. Harris, Small Dog Electronics + 796 Kittikun, TH +* 798 aerialist, Japan + 799 Sweta +* 800 Mark Shuttleworth + 802 Kim Thostrup + 803 Andy Fundinger + 810 Matt Vallevand, Detroit MI + 813 Jim McDonald + 816 Rob Dobson + 817 Rafał Zieliński, PL +* 818 Shaun Walker, AUS + 819 Timothy R, Belgium + 820 clem + 825 JuanB, ES + 826 Randall Gaz, Colorado USA + 827 Dick van Ginkel, The Netherlands + 829 Jan-Pieter Van Impe + 831 David Kirkpatrick, AU + 832 Ravi Teja, India + 833 AkosLukacs, HU + 834 Dave Desson, CAN + 837 LWQ.CZ, CZ + 838 Robert W., Issaquah, WA + 839 Daniel Hrynczenko + 840 Martin Filtenborg, DK + 841 InnHuchen, Ger + 845 Raju Pillai,India + 847 cfus/DE +* 851 Juli H. + 853 David Monterroso Cabello , SP + 857 24x8, LLC, US + 860 Sebastian, DE + 861 pajusmar + 864 Ronnie, UK +* 867 Travis Travelstead, USA +* 870 Woodat, US/UK + 872 Gary Bake, UK + 873 Ernesto Martinez +* 874 Scottt, USA + 876 Ronnie Kizzle, LA + 880 Harish, Singapore + 882 Wacht, Pittsburgh + 883 PatrickF, US + 886 Paolo, IT + 888 Defragster + 889 Rachel Rayns, UK +* 890 Peak Data LLC + 891 Mindwarp, AU + 892 Vincent Smedley, UK +* 894 Bailey & Brayden + 898 Jacek Artymiak, UK + 900 John Hudson, USA +* 901 ReneS, NL +* 902 B Stevens + 903 Cptnslick, US + 904 janlj@me.com + 905 Fabricio Biazzotto + 906 Lenz Hirsch + 907 SerSher, RU + 908 Florian, DE + 909 Mathias Svendsen, DK +* 910 Jeremiah Dey-Oh + 911 Allan Joseph Medwick + 913 Matt, Australia + 914 Christian Pedersen +* 915 SPIN + 916 Denis M., Russia + 917 Ahmed Alboori, Saudi Arabia + 918 Luciano, Italy + 919 Ragdehl +* 921 Artur, HU + 922 Greg, NC - USA + 924 Gurzixo +* 927 Gregg, Oregon + 928 cwschroeder, BY + 929 W. Bush - NY, USA. + 932 ddparker + 933 Enkion +* 934 Eric G. Barron + 936 thomasDOTwtf + 940 mifous, cucurbitae.eu + 942 VFL68, FR + 943 Casey, Hong Kong +* 945 Kean Electronics + 946 Nima, UK + 947 Klosinski, USA + 948 PieWiE, NL +* 949 Rui Carmo, PT +* 950 basbrun.com + 951 Aashu, UK +* 952 vk2nq - Brian + 954 gojimmypi + 955 Jack, USA +* 957 @SteveBattle +* 958 Beshr, Sweden + 962 PeterR, UK + 964 Russell Calbert + 965 LAurent_B, Fr + 967 Qazi, USA + 971 Jonas, FR + 973 PK Shiu +* 974 sea_kev + 976 Radhika, USA + 977 Chris Gibson, US +* 978 Mike, AU +* 979 Geeky Pete + 981 Timmy the wonderdog + 983 An Ostler it IT + 984 Frank Ray Robles + 985 Kurtsik + 987 Johan, SE + 988 NJBerland, Norway + 992 Leon Noel - @leonnoel + 994 Kjell, SE + 995 boriskourt + 997 Bartek B., CANADA + 999 Thomas Wiradikusuma, Indonesia + 1000 Trey, NOLA + 1002 Jori, FI + 1005 nmmarkin + 1006 Mattias Fornander + 1007 Panayot Daskalov, Bulgaria +*1009 AndyP, UK + 1011 TSD + 1013 Chris, Berlin + 1017 Gareth Edwards, UK + 1018 Trixam,DE + 1019 César from Makespace Madrid, Spain + 1020 Prajwal, Australia +*1024 Fred Dart - FTDI + 1025 bsx +*1026 Regis, FR + 1027 Adrian Hill + 1029 Alice, UK + 1030 Erkan Shakir, BG + 1031 Alexander, EE + 1033 Patric, Luxembourg + 1034 For my beloved mother, Colleen Clancy. + 1035 NigelB + 1037 François, Aus/Fr +*1039 Thanura Siribaddana, Australia + 1041 Harald, USA + 1042 Jeremy Utting, NZ + 1043 bejuryu, KR +*1044 Daniel Wood, UK + 1046 C. J. Blocker +*1047 Rodrigo Benenson, Germany + 1048 Håvard Gulldahl + 1049 SeB, Belgium + 1054 Ryan Miller, Austin TX + 1055 Gianluca Cancelmi + 1057 Francesco, IT + 1058 RockTractor! + 1060 Bill G., Atlanta GA USA + 1061 joenotjoe + 1064 ATrivedi, USA + 1067 Jim Chandler, UK + 1068 Aria Sabeti + 1069 Noah Rosamilia, USA + 1070 GAKgDavid, CA + 1072 Markus, Austria +*1073 Tarwin, MUC +*1077 Balazs Kinszler, HU +*1080 pfh +*1082 Ovidiu Hossu, SG +*1083 mmhanif, NJ +*1084 Wincent Balin, DE +*1086 Anatoly Verkhovsky +*1087 Greg, Plano +*1089 Angelo Compagnucci + 1090 Ryan Shaw (ryannathans), AU + 1092 Dries007, BE +*1093 Dave Snowdon, UK +*1094 halfpress +*1096 DeuxVis, FR +*1097 Your Creative Solutions + 1099 Emanuele Goldoni, IT +*1100 Tendayi Mawushe + 1101 Rob, Tikitere +*1102 SolidStateSoul +*1103 Michael, GER +*1106 Paul, San Francisco +*1107 Oddvar Lovaas +*1108 Doc Savage, Man of Bronze + 1109 Stijn Debrouwere + 1111 Ark Nieckarz, USA +*1112 ECS87.com, USA +*1114 Gary P. Wolfe, USA + 1117 Tom Hodson +*1118 @arikb (twitter) + 1123 Piotr Gryko UK +*1125 Cantalaweb, Spain + 1126 Edward of Clovis + 1127 Jim G +*1128 billbr, Loveland, CO, USA + 1129 dalanmiller +*1130 StephenH, UK +*1132 Thomas Sarlandie - @sarfata + 1133 Doug Rohm, US +*1134 Eric Floehr, Ohio, USA +*1135 Sven Haiges + 1136 relix42 +*1137 Ralf Nyren +*1138 nickgb + 1139 zwack, DE + 1140 Michal B., PL + 1141 Matt, Australia + 1143 slv, Mi2 + 1144 Pawel, CH +*1145 James Saffery +*1147 nekomatic +*1149 @nt1, Earth +*1150 Alister Galpin, NZ + 1151 Jayemel, UK + 1152 Koalabs + 1153 James Myatt, UK +*1154 DanS, Norway + 1155 Sandeep, US +*1156 Anil Kavipurapu +*1158 Frederik Werner, DE + 1160 Erik J, Canada + 1164 bluezebra, Ireland + 1168 Birk, DE + 1169 Gabi, FR +*1173 mliberty, USA + 1174 Jamie Smith, Scotland + 1175 Sebastian, Germany +*1176 John Cooper, UK + 1177 Moritz, DE + 1178 Kevin, DE +*1179 Ming Leung, Canada + 1180 Laird Popkin + 1181 tasmaniac, GA +*1183 RichardW, UK +*1187 Thomas Quinlan, London, UK + 1188 LGnap, BE +*1189 bloater, Edinburgh UK + 1192 pakt, SE + 1194 Sandsmark, NO +*1195 Gert Menke + 1197 Emsi88, SK + 1199 GTtronics HK Ltd. + 1200 Jo, Bergen +*1202 MarkS, Australia + 1203 Igor, HR + 1204 Lord Nightmare + 1205 Great Uncle Bulgaria, UK +*1206 salomonderossi + 1208 Master_Ipse, DE + 1209 Luis G.F, ES + 1211 Harald, FO +*1212 Kimmo, Finland +*1213 P. Perreijn, Netherlands + 1214 jcea, Spain + 1215 simon holmes à court + 1217 Bill M, Newcastle +*1218 snowball +*1221 Georges, CDN + 1222 JPLa + 1225 Erik Gullberg, Sweden + 1226 Matthias Fuchs, IN, Germany + 1229 Majed, CA + 1230 Michiel, Reeuwijk + 1231 Clive, Essex UK + 1232 Jan Kalina, CZ + 1234 MBBest, Australia +*1235 Reinoud de Lange, NL + 1237 Jeffrey Park, South Korea + 1238 David Olson + 1239 Nathan Battan + 1240 Marcus, TW + 1241 randyrrt, USA + 1242 Holger, Germany + 1243 Dmitri Chapkine, FRANCE + 1244 Ceyhun Kapucu, TR + 1245 Hong Kong +*1246 gPozo, US + 1247 Peter M, Sweden +*1249 Duncan, Cambridge +*1251 Schaeferling, DE + 1252 Christian Prior, DE +*1256 ovig + 1257 Kerry Channing, UK + 1258 Exception42, GER +*1259 nchalikias + 1261 Kittie, US + 1263 Alex, Norway + 1264 wats0n, TW +*1265 Henner +*1266 Mike M, AZ, USA + 1268 Bobby Ly, USA +*1269 Espen STO, Norway + 1270 arduware.cc + 1274 Christopher Flynn, NH USA +*1275 Bruce Boyes, USA + 1276 DCH + 1278 McGinkel, Netherlands + 1279 Dieter, Wien + 1280 R. Tummers, NL + 1283 Pranav Maddula, USA + 1286 Dusan, SLovakia + 1290 Stephen Youndt +*1291 Lertsenem, FR + 1292 NuclearTide, London + 1293 Ben Gift, USA + 1294 rmg + 1295 jmaybe, USA + 1296 Allan G, Georgia + 1297 Duncan Brassington, UK + 1300 Hans, NL + 1301 Valerio "valdez" Paolini, IT + 1303 Neotreat, DE + 1306 tomtoump + 1307 Edward B Cox, England + 1310 Oliver Steele + 1311 merps, AUS + 1313 n8henrie, USA +*1314 YGA-KSD n7/ULB, FR-BE + 1317 Adrian, Romania +*1318 Luca "Loop", ITA +*1319 Michael Twomey, Ireland + 1321 Trey Aughenbaugh + 1322 Marcel Hecko, SK + 1323 Hugo Neira, CL + 1326 JH, US +*1330 Luthander, SE + 1331 Rickard Dahlstrand, Sweden + 1333 Olivier M., France + 1334 DWVL, UK + 1335 MRZANE, Sweden + 1336 Benedikt, DE +*1338 Tiegeng, US +*1339 arthoo Eindhoven Nederland + 1340 Magnus Gustavsson, Sweden + 1341 Jan Bednařík + 1344 Mike McGary: US + 1346 mp3tobi +*1350 Cyberhippy + 1351 Sandro, PT + 1355 Kwabena W. Agyeman + 1357 Ryan Young +*1358 Chiang Mai, Thailand + 1359 AKLitman, USA + 1360 JASK Enterprises, Ltd-John +*1361 Tom Gidden, UK + 1362 AdamT, USA + 1363 Jose de la Campa, BOL + 1365 Steve Laguna, U.S.A +*1368 Walrusklasse, NL + 1370 Timofei Korostelev, Belarus + 1374 Janos,HU +*1375 Paul Cunnane + 1377 IanE, UK + 1378 Hans, NL + 1379 Jose Angel Jimenez Vadillo, Spain +*1380 PaulT, Lancs + 1383 Lutz; DE + 1385 AnRkey + 1387 Fredrik, FIN + 1388 Matt W (funkyHat) + 1389 Zeev Rotshtein, Israel + 1391 joostd, NL + 1392 Lukasz Blaszczyk, USA +*1397 Wei-Ning Huang, TW + 1398 myu +*1399 Thorsten, Germany + 1401 sm0ihr + 1403 Xiaotian, Seattle US +*1406 -gt-, Czech Republic + 1407 Mike Y. Diallo, US + 1409 ubii, US diff --git a/components/language/micropython/CODECONVENTIONS.md b/components/language/micropython/CODECONVENTIONS.md new file mode 100644 index 00000000..78fb912a --- /dev/null +++ b/components/language/micropython/CODECONVENTIONS.md @@ -0,0 +1,235 @@ +Git commit conventions +====================== + +Each commit message should start with a directory or full file path +prefix, so it was clear which part of codebase a commit affects. If +a change affects one file, it's better to use path to a file. If it +affects few files in a subdirectory, using subdirectory as a prefix +is ok. For longish paths, it's acceptable to drop intermediate +components, which still should provide good context of a change. +It's also ok to drop file extensions. + +Besides prefix, first line of a commit message should describe a +change clearly and to the point, and be a grammatical sentence with +final full stop. First line should fit within 72 characters. Examples +of good first line of commit messages: + + py/objstr: Add splitlines() method. + py: Rename FOO to BAR. + docs/machine: Fix typo in reset() description. + ports: Switch to use lib/foo instead of duplicated code. + +After the first line add an empty line and in the following lines describe +the change in a detail, if needed, with lines fitting within 75 characters +(with an exception for long items like URLs which cannot be broken). Any +change beyond 5 lines would likely require such detailed description. + +To get good practical examples of good commits and their messages, browse +the `git log` of the project. + +When committing you are encouraged to sign-off your commit by adding +"Signed-off-by" lines and similar, eg using "git commit -s". If you don't +explicitly sign-off in this way then the commit message, which includes your +name and email address in the "Author" line, implies your sign-off. In either +case, of explicit or implicit sign-off, you are certifying and signing off +against the following: + +* That you wrote the change yourself, or took it from a project with + a compatible license (in the latter case the commit message, and possibly + source code should provide reference where the implementation was taken + from and give credit to the original author, as required by the license). +* That you are allowed to release these changes to an open-source project + (for example, changes done during paid work for a third party may require + explicit approval from that third party). +* That you (or your employer) agree to release the changes under + MicroPython's license, which is the MIT license. Note that you retain + copyright for your changes (for smaller changes, the commit message + conveys your copyright; if you make significant changes to a particular + source module, you're welcome to add your name to the file header). +* Your contribution including commit message will be publicly and + indefinitely available for anyone to access, including redistribution + under the terms of the project's license. +* Your signature for all of the above, which is the "Signed-off-by" line + or the "Author" line in the commit message, includes your full real name and + a valid and active email address by which you can be contacted in the + foreseeable future. + +Code auto-formatting +==================== + +Both C and Python code are auto-formatted using the `tools/codeformat.py` +script. This uses [uncrustify](https://github.com/uncrustify/uncrustify) to +format C code and [black](https://github.com/psf/black) to format Python code. +After making changes, and before committing, run this tool to reformat your +changes to the correct style. Without arguments this tool will reformat all +source code (and may take some time to run). Otherwise pass as arguments to +the tool the files that changed and it will only reformat those. + +Python code conventions +======================= + +Python code follows [PEP 8](https://legacy.python.org/dev/peps/pep-0008/) and +is auto-formatted using [black](https://github.com/psf/black) with a line-length +of 99 characters. + +Naming conventions: +- Module names are short and all lowercase; eg pyb, stm. +- Class names are CamelCase, with abbreviations all uppercase; eg I2C, not + I2c. +- Function and method names are all lowercase with words separated by + a single underscore as necessary to improve readability; eg mem_read. +- Constants are all uppercase with words separated by a single underscore; + eg GPIO_IDR. + +C code conventions +================== + +C code is auto-formatted using [uncrustify](https://github.com/uncrustify/uncrustify) +and the corresponding configuration file `tools/uncrustify.cfg`, with a few +minor fix-ups applied by `tools/codeformat.py`. When writing new C code please +adhere to the existing style and use `tools/codeformat.py` to check any changes. +The main conventions, and things not enforceable via the auto-formatter, are +described below. + +White space: +- Expand tabs to 4 spaces. +- Don't leave trailing whitespace at the end of a line. +- For control blocks (if, for, while), put 1 space between the + keyword and the opening parenthesis. +- Put 1 space after a comma, and 1 space around operators. + +Braces: +- Use braces for all blocks, even no-line and single-line pieces of + code. +- Put opening braces on the end of the line it belongs to, not on + a new line. +- For else-statements, put the else on the same line as the previous + closing brace. + +Header files: +- Header files should be protected from multiple inclusion with #if + directives. See an existing header for naming convention. + +Names: +- Use underscore_case, not camelCase for all names. +- Use CAPS_WITH_UNDERSCORE for enums and macros. +- When defining a type use underscore_case and put '_t' after it. + +Integer types: MicroPython runs on 16, 32, and 64 bit machines, so it's +important to use the correctly-sized (and signed) integer types. The +general guidelines are: +- For most cases use mp_int_t for signed and mp_uint_t for unsigned + integer values. These are guaranteed to be machine-word sized and + therefore big enough to hold the value from a MicroPython small-int + object. +- Use size_t for things that count bytes / sizes of objects. +- You can use int/uint, but remember that they may be 16-bits wide. +- If in doubt, use mp_int_t/mp_uint_t. + +Comments: +- Be concise and only write comments for things that are not obvious. +- Use `// ` prefix, NOT `/* ... */`. No extra fluff. + +Memory allocation: +- Use m_new, m_renew, m_del (and friends) to allocate and free heap memory. + These macros are defined in py/misc.h. + +Examples +-------- + +Braces, spaces, names and comments: + + #define TO_ADD (123) + + // This function will always recurse indefinitely and is only used to show + // coding style + int foo_function(int x, int some_value) { + if (x < some_value) { + foo(some_value, x); + } else { + foo(x + TO_ADD, some_value - 1); + } + + for (int my_counter = 0; my_counter < x; ++my_counter) { + } + } + +Type declarations: + + typedef struct _my_struct_t { + int member; + void *data; + } my_struct_t; + +Documentation conventions +========================= + +MicroPython generally follows CPython in documentation process and +conventions. reStructuredText syntax is used for the documention. + +Specific conventions/suggestions: + +* Use `*` markup to refer to arguments of a function, e.g.: + +``` +.. method:: poll.unregister(obj) + + Unregister *obj* from polling. +``` + +* Use following syntax for cross-references/cross-links: + +``` +:func:`foo` - function foo in current module +:func:`module1.foo` - function foo in module "module1" + (similarly for other referent types) +:class:`Foo` - class Foo +:meth:`Class.method1` - method1 in Class +:meth:`~Class.method1` - method1 in Class, but rendered just as "method1()", + not "Class.method1()" +:meth:`title ` - reference method1, but render as "title" (use only + if really needed) +:mod:`module1` - module module1 + +`symbol` - generic xref syntax which can replace any of the above in case + the xref is unambiguous. If there's ambiguity, there will be a warning + during docs generation, which need to be fixed using one of the syntaxes + above +``` + +* Cross-referencing arbitrary locations +~~~ +.. _xref_target: + +Normal non-indented text. + +This is :ref:`reference `. + +(If xref target is followed by section title, can be just +:ref:`xref_target`). +~~~ + +* Linking to external URL: +``` +`link text `_ +``` + +* Referencing builtin singleton objects: +``` +``None``, ``True``, ``False`` +``` + +* Use following syntax to create common description for more than one element: +~~~ +.. function:: foo(x) + bar(y) + + Description common to foo() and bar(). +~~~ + + +More detailed guides and quickrefs: + +* http://www.sphinx-doc.org/en/stable/rest.html +* http://www.sphinx-doc.org/en/stable/markup/inline.html +* http://docutils.sourceforge.net/docs/user/rst/quickref.html diff --git a/components/language/micropython/CODEOFCONDUCT.md b/components/language/micropython/CODEOFCONDUCT.md new file mode 100644 index 00000000..07cf8771 --- /dev/null +++ b/components/language/micropython/CODEOFCONDUCT.md @@ -0,0 +1,53 @@ +MicroPython Code of Conduct +=========================== + +The MicroPython community is made up of members from around the globe with a +diverse set of skills, personalities, and experiences. It is through these +differences that our community experiences great successes and continued growth. +When you're working with members of the community, this Code of Conduct will +help steer your interactions and keep MicroPython a positive, successful, and +growing community. + +Members of the MicroPython community are open, considerate, and respectful. +Behaviours that reinforce these values contribute to a positive environment, and +include: acknowledging time and effort, being respectful of differing viewpoints +and experiences, gracefully accepting constructive criticism, and using +welcoming and inclusive language. + +Every member of our community has the right to have their identity respected. +The MicroPython community is dedicated to providing a positive experience for +everyone, regardless of age, gender identity and expression, sexual orientation, +disability, physical appearance, body size, ethnicity, nationality, race, or +religion (or lack thereof), education, or socio-economic status. + +Unacceptable behaviour includes: harassment, trolling, deliberate intimidation, +violent threats or language directed against another person; insults, put downs, +or jokes that are based upon stereotypes, that are exclusionary, or that hold +others up for ridicule; unwelcome sexual attention or advances; sustained +disruption of community discussions; publishing others' private information +without explicit permission; and other conduct that is inappropriate for a +professional audience including people of many different backgrounds. + +This code of conduct covers all online and offline presence related to the +MicroPython project, including GitHub and the forum. If a participant engages +in behaviour that violates this code of conduct, the MicroPython team may take +action as they deem appropriate, including warning the offender or expulsion +from the community. Community members asked to stop any inappropriate behaviour +are expected to comply immediately. + +Thank you for helping make this a welcoming, friendly community for everyone. + +If you believe that someone is violating the code of conduct, or have any other +concerns, please contact a member of the MicroPython team by emailing +contact@micropython.org. + +License +------- + +This Code of Conduct is licensed under the Creative Commons +Attribution-ShareAlike 3.0 Unported License. + +Attributions +------------ + +Based on the Python code of conduct found at https://www.python.org/psf/conduct/ diff --git a/components/language/micropython/CONTRIBUTING.md b/components/language/micropython/CONTRIBUTING.md new file mode 100644 index 00000000..73004ac5 --- /dev/null +++ b/components/language/micropython/CONTRIBUTING.md @@ -0,0 +1,8 @@ +When reporting an issue and especially submitting a pull request, please +make sure that you are acquainted with Contributor Guidelines: + +https://github.com/micropython/micropython/wiki/ContributorGuidelines + +as well as the Code Conventions, which includes details of how to commit: + +https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md diff --git a/components/language/micropython/LICENSE b/components/language/micropython/LICENSE new file mode 100644 index 00000000..2b9a64b8 --- /dev/null +++ b/components/language/micropython/LICENSE @@ -0,0 +1,85 @@ +The MIT License (MIT) + +Copyright (c) 2013-2022 Damien P. George + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------------------------------------------------------------------- + +Unless specified otherwise (see below), the above license and copyright applies +to all files in this repository. + +Individual files may include additional copyright holders. + +The various ports of MicroPython may include third-party software that is +licensed under different terms. These licenses are summarised in the tree +below, please refer to these files and directories for further license and +copyright information. Note that (L)GPL-licensed code listed below is only +used during the build process and is not part of the compiled source code. + +/ (MIT) + /drivers + /cc3000 (BSD-3-clause) + /cc3100 (BSD-3-clause) + /wiznet5k (BSD-3-clause) + /lib + /asf4 (Apache-2.0) + /axtls (BSD-3-clause) + /config + /scripts + /config (GPL-2.0-or-later) + /Rules.mak (GPL-2.0) + /berkeley-db-1xx (BSD-4-clause) + /btstack (See btstack/LICENSE) + /cmsis (BSD-3-clause) + /crypto-algorithms (NONE) + /libhydrogen (ISC) + /littlefs (BSD-3-clause) + /lwip (BSD-3-clause) + /mynewt-nimble (Apache-2.0) + /nrfx (BSD-3-clause) + /nxp_driver (BSD-3-Clause) + /oofatfs (BSD-1-clause) + /pico-sdk (BSD-3-clause) + /re15 (BSD-3-clause) + /stm32lib (BSD-3-clause) + /tinytest (BSD-3-clause) + /tinyusb (MIT) + /uzlib (Zlib) + /logo (uses OFL-1.1) + /ports + /cc3200 + /hal (BSD-3-clause) + /simplelink (BSD-3-clause) + /FreeRTOS (GPL-2.0 with FreeRTOS exception) + /stm32 + /usbd*.c (MCD-ST Liberty SW License Agreement V2) + /stm32_it.* (MIT + BSD-3-clause) + /system_stm32*.c (MIT + BSD-3-clause) + /boards + /startup_stm32*.s (BSD-3-clause) + /*/stm32*.h (BSD-3-clause) + /usbdev (MCD-ST Liberty SW License Agreement V2) + /usbhost (MCD-ST Liberty SW License Agreement V2) + /teensy + /core (PJRC.COM) + /zephyr + /src (Apache-2.0) + /tools + /dfu.py (LGPL-3.0-only) diff --git a/components/language/micropython/README.md b/components/language/micropython/README.md new file mode 100644 index 00000000..920f10a5 --- /dev/null +++ b/components/language/micropython/README.md @@ -0,0 +1,188 @@ +[![CI badge](https://github.com/micropython/micropython/workflows/unix%20port/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush) [![codecov](https://codecov.io/gh/micropython/micropython/branch/master/graph/badge.svg?token=I92PfD05sD)](https://codecov.io/gh/micropython/micropython) + +The MicroPython project +======================= +

+ MicroPython Logo +

+ +This is the MicroPython project, which aims to put an implementation +of Python 3.x on microcontrollers and small embedded systems. +You can find the official website at [micropython.org](http://www.micropython.org). + +WARNING: this project is in beta stage and is subject to changes of the +code-base, including project-wide name changes and API changes. + +MicroPython implements the entire Python 3.4 syntax (including exceptions, +`with`, `yield from`, etc., and additionally `async`/`await` keywords from +Python 3.5). The following core datatypes are provided: `str` (including +basic Unicode support), `bytes`, `bytearray`, `tuple`, `list`, `dict`, `set`, +`frozenset`, `array.array`, `collections.namedtuple`, classes and instances. +Builtin modules include `sys`, `time`, and `struct`, etc. Select ports have +support for `_thread` module (multithreading). Note that only a subset of +Python 3 functionality is implemented for the data types and modules. + +MicroPython can execute scripts in textual source form or from precompiled +bytecode, in both cases either from an on-device filesystem or "frozen" into +the MicroPython executable. + +See the repository http://github.com/micropython/pyboard for the MicroPython +board (PyBoard), the officially supported reference electronic circuit board. + +Major components in this repository: +- py/ -- the core Python implementation, including compiler, runtime, and + core library. +- mpy-cross/ -- the MicroPython cross-compiler which is used to turn scripts + into precompiled bytecode. +- ports/unix/ -- a version of MicroPython that runs on Unix. +- ports/stm32/ -- a version of MicroPython that runs on the PyBoard and similar + STM32 boards (using ST's Cube HAL drivers). +- ports/minimal/ -- a minimal MicroPython port. Start with this if you want + to port MicroPython to another microcontroller. +- tests/ -- test framework and test scripts. +- docs/ -- user documentation in Sphinx reStructuredText format. Rendered + HTML documentation is available at http://docs.micropython.org. + +Additional components: +- ports/bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used + mostly to control code size. +- ports/teensy/ -- a version of MicroPython that runs on the Teensy 3.1 + (preliminary but functional). +- ports/pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers. +- ports/cc3200/ -- a version of MicroPython that runs on the CC3200 from TI. +- ports/esp8266/ -- a version of MicroPython that runs on Espressif's ESP8266 SoC. +- ports/esp32/ -- a version of MicroPython that runs on Espressif's ESP32 SoC. +- ports/nrf/ -- a version of MicroPython that runs on Nordic's nRF51 and nRF52 MCUs. +- extmod/ -- additional (non-core) modules implemented in C. +- tools/ -- various tools, including the pyboard.py module. +- examples/ -- a few example Python scripts. + +The subdirectories above may include READMEs with additional info. + +"make" is used to build the components, or "gmake" on BSD-based systems. +You will also need bash, gcc, and Python 3.3+ available as the command `python3` +(if your system only has Python 2.7 then invoke make with the additional option +`PYTHON=python2`). + +The MicroPython cross-compiler, mpy-cross +----------------------------------------- + +Most ports require the MicroPython cross-compiler to be built first. This +program, called mpy-cross, is used to pre-compile Python scripts to .mpy +files which can then be included (frozen) into the firmware/executable for +a port. To build mpy-cross use: + + $ cd mpy-cross + $ make + +The Unix version +---------------- + +The "unix" port requires a standard Unix environment with gcc and GNU make. +x86 and x64 architectures are supported (i.e. x86 32- and 64-bit), as well +as ARM and MIPS. Making full-featured port to another architecture requires +writing some assembly code for the exception handling and garbage collection. +Alternatively, fallback implementation based on setjmp/longjmp can be used. + +To build (see section below for required dependencies): + + $ cd ports/unix + $ make submodules + $ make + +Then to give it a try: + + $ ./micropython + >>> list(5 * x + y for x in range(10) for y in [4, 2, 1]) + +Use `CTRL-D` (i.e. EOF) to exit the shell. +Learn about command-line options (in particular, how to increase heap size +which may be needed for larger applications): + + $ ./micropython -h + +Run complete testsuite: + + $ make test + +Unix version comes with a builtin package manager called upip, e.g.: + + $ ./micropython -m upip install micropython-pystone + $ ./micropython -m pystone + +Browse available modules on +[PyPI](https://pypi.python.org/pypi?%3Aaction=search&term=micropython). +Standard library modules come from +[micropython-lib](https://github.com/micropython/micropython-lib) project. + +External dependencies +--------------------- + +Building MicroPython ports may require some dependencies installed. + +For Unix port, `libffi` library and `pkg-config` tool are required. On +Debian/Ubuntu/Mint derivative Linux distros, install `build-essential` +(includes toolchain and make), `libffi-dev`, and `pkg-config` packages. + +Other dependencies can be built together with MicroPython. This may +be required to enable extra features or capabilities, and in recent +versions of MicroPython, these may be enabled by default. To build +these additional dependencies, in the port directory you're +interested in (e.g. `ports/unix/`) first execute: + + $ make submodules + +This will fetch all the relevant git submodules (sub repositories) that +the port needs. Use the same command to get the latest versions of +submodules as they are updated from time to time. After that execute: + + $ make deplibs + +This will build all available dependencies (regardless whether they +are used or not). If you intend to build MicroPython with additional +options (like cross-compiling), the same set of options should be passed +to `make deplibs`. To actually enable/disable use of dependencies, edit +`ports/unix/mpconfigport.mk` file, which has inline descriptions of the options. +For example, to build SSL module (required for `upip` tool described above, +and so enabled by default), `MICROPY_PY_USSL` should be set to 1. + +For some ports, building required dependences is transparent, and happens +automatically. But they still need to be fetched with the `make submodules` +command. + +The STM32 version +----------------- + +The "stm32" port requires an ARM compiler, arm-none-eabi-gcc, and associated +bin-utils. For those using Arch Linux, you need arm-none-eabi-binutils, +arm-none-eabi-gcc and arm-none-eabi-newlib packages. Otherwise, try here: +https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm + +To build: + + $ cd ports/stm32 + $ make submodules + $ make + +You then need to get your board into DFU mode. On the pyboard, connect the +3V3 pin to the P1/DFU pin with a wire (on PYBv1.0 they are next to each other +on the bottom left of the board, second row from the bottom). + +Then to flash the code via USB DFU to your device: + + $ make deploy + +This will use the included `tools/pydfu.py` script. If flashing the firmware +does not work it may be because you don't have the correct permissions, and +need to use `sudo make deploy`. +See the README.md file in the ports/stm32/ directory for further details. + +Contributing +------------ + +MicroPython is an open-source project and welcomes contributions. To be +productive, please be sure to follow the +[Contributors' Guidelines](https://github.com/micropython/micropython/wiki/ContributorGuidelines) +and the [Code Conventions](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md). +Note that MicroPython is licenced under the MIT license, and all contributions +should follow this license. diff --git a/components/language/micropython/docs/Makefile b/components/language/micropython/docs/Makefile new file mode 100644 index 00000000..05709617 --- /dev/null +++ b/components/language/micropython/docs/Makefile @@ -0,0 +1,191 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +PYTHON = python3 +SPHINXOPTS = -W --keep-going +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build/$(MICROPY_PORT) +CPYDIFFDIR = ../tools +CPYDIFF = gen-cpydiff.py +GENRSTDIR = genrst +# Run "make FORCE= ..." to avoid rebuilding from scratch (and risk +# producing incorrect docs). +FORCE = -E + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " cpydiff to generate the MicroPython differences from CPython" + +clean: + rm -rf $(BUILDDIR)/* + rm -f $(GENRSTDIR)/* + +cpydiff: + @echo "Generating MicroPython Differences." + rm -f $(GENRSTDIR)/* + cd $(CPYDIFFDIR) && $(PYTHON) $(CPYDIFF) + +html: cpydiff + $(SPHINXBUILD) $(FORCE) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MicroPython.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MicroPython.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/MicroPython" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MicroPython" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: cpydiff + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: cpydiff + $(SPHINXBUILD) $(FORCE) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: cpydiff + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/components/language/micropython/docs/README.md b/components/language/micropython/docs/README.md new file mode 100644 index 00000000..1591911c --- /dev/null +++ b/components/language/micropython/docs/README.md @@ -0,0 +1,53 @@ +MicroPython Documentation +========================= + +The MicroPython documentation can be found at: +http://docs.micropython.org/en/latest/ + +The documentation you see there is generated from the files in the docs tree: +https://github.com/micropython/micropython/tree/master/docs + +Building the documentation locally +---------------------------------- + +If you're making changes to the documentation, you may want to build the +documentation locally so that you can preview your changes. + +Install Sphinx, and optionally (for the RTD-styling), sphinx_rtd_theme, +preferably in a virtualenv: + + pip install sphinx + pip install sphinx_rtd_theme + +In `micropython/docs`, build the docs: + + make html + +You'll find the index page at `micropython/docs/build/html/index.html`. + +Having readthedocs.org build the documentation +---------------------------------------------- + +If you would like to have docs for forks/branches hosted on GitHub, GitLab or +BitBucket an alternative to building the docs locally is to sign up for a free +https://readthedocs.org account. The rough steps to follow are: +1. sign-up for an account, unless you already have one +2. in your account settings: add GitHub as a connected service (assuming +you have forked this repo on github) +3. in your account projects: import your forked/cloned micropython repository +into readthedocs +4. in the project's versions: add the branches you are developing on or +for which you'd like readthedocs to auto-generate docs whenever you +push a change + +PDF manual generation +--------------------- + +This can be achieved with: + + make latexpdf + +but require rather complete install of LaTeX with various extensions. On +Debian/Ubuntu, try (500MB+ download): + + apt-get install texlive-latex-recommended texlive-latex-extra diff --git a/components/language/micropython/docs/conf.py b/components/language/micropython/docs/conf.py new file mode 100644 index 00000000..a21e8d5f --- /dev/null +++ b/components/language/micropython/docs/conf.py @@ -0,0 +1,301 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# MicroPython documentation build configuration file, created by +# sphinx-quickstart on Sun Sep 21 11:42:03 2014. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('.')) + +# The members of the html_context dict are available inside topindex.html +micropy_version = os.getenv('MICROPY_VERSION') or 'latest' +micropy_all_versions = (os.getenv('MICROPY_ALL_VERSIONS') or 'latest').split(',') +url_pattern = '%s/en/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',) +html_context = { + 'cur_version':micropy_version, + 'all_versions':[ + (ver, url_pattern % ver) for ver in micropy_all_versions + ], + 'downloads':[ + ('PDF', url_pattern % micropy_version + '/micropython-docs.pdf'), + ], +} + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'MicroPython' +copyright = '- The MicroPython Documentation is Copyright © 2014-2022, Damien P. George, Paul Sokolovsky, and contributors' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags" +# breakdown, so use the same version identifier for both to avoid confusion. +version = release = '1.19' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['build', '.venv'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +default_role = 'any' + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# Global include files. Sphinx docs suggest using rst_epilog in preference +# of rst_prolog, so we follow. Absolute paths below mean "from the base +# of the doctree". +rst_epilog = """ +.. include:: /templates/replace.inc +""" + +# -- Options for HTML output ---------------------------------------------- + +# on_rtd is whether we are on readthedocs.org +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +if not on_rtd: # only import and set the theme if we're building docs locally + try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.'] + except: + html_theme = 'default' + html_theme_path = ['.'] +else: + html_theme_path = ['.'] + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = ['.'] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = '../../logo/trans-logo.png' + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +html_favicon = 'static/favicon.ico' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%d %b %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +html_additional_pages = {"index": "topindex.html"} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'MicroPythondoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +# Include 3 levels of headers in PDF ToC +'preamble': '\setcounter{tocdepth}{2}', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'MicroPython.tex', 'MicroPython Documentation', + 'Damien P. George, Paul Sokolovsky, and contributors', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'micropython', 'MicroPython Documentation', + ['Damien P. George, Paul Sokolovsky, and contributors'], 1), +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'MicroPython', 'MicroPython Documentation', + 'Damien P. George, Paul Sokolovsky, and contributors', 'MicroPython', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None)} diff --git a/components/language/micropython/docs/develop/cmodules.rst b/components/language/micropython/docs/develop/cmodules.rst new file mode 100644 index 00000000..143057f7 --- /dev/null +++ b/components/language/micropython/docs/develop/cmodules.rst @@ -0,0 +1,266 @@ +.. _cmodules: + +MicroPython external C modules +============================== + +When developing modules for use with MicroPython you may find you run into +limitations with the Python environment, often due to an inability to access +certain hardware resources or Python speed limitations. + +If your limitations can't be resolved with suggestions in :ref:`speed_python`, +writing some or all of your module in C (and/or C++ if implemented for your port) +is a viable option. + +If your module is designed to access or work with commonly available +hardware or libraries please consider implementing it inside the MicroPython +source tree alongside similar modules and submitting it as a pull request. +If however you're targeting obscure or proprietary systems it may make +more sense to keep this external to the main MicroPython repository. + +This chapter describes how to compile such external modules into the +MicroPython executable or firmware image. Both Make and CMake build +tools are supported, and when writing an external module it's a good idea to +add the build files for both of these tools so the module can be used on all +ports. But when compiling a particular port you will only need to use one +method of building, either Make or CMake. + +An alternative approach is to use :ref:`natmod` which allows writing custom C +code that is placed in a .mpy file, which can be imported dynamically in to +a running MicroPython system without the need to recompile the main firmware. + + +Structure of an external C module +--------------------------------- + +A MicroPython user C module is a directory with the following files: + +* ``*.c`` / ``*.cpp`` / ``*.h`` source code files for your module. + + These will typically include the low level functionality being implemented and + the MicroPython binding functions to expose the functions and module(s). + + Currently the best reference for writing these functions/modules is + to find similar modules within the MicroPython tree and use them as examples. + +* ``micropython.mk`` contains the Makefile fragment for this module. + + ``$(USERMOD_DIR)`` is available in ``micropython.mk`` as the path to your + module directory. As it's redefined for each c module, is should be expanded + in your ``micropython.mk`` to a local make variable, + eg ``EXAMPLE_MOD_DIR := $(USERMOD_DIR)`` + + Your ``micropython.mk`` must add your modules source files relative to your + expanded copy of ``$(USERMOD_DIR)`` to ``SRC_USERMOD``, eg + ``SRC_USERMOD += $(EXAMPLE_MOD_DIR)/example.c`` + + If you have custom compiler options (like ``-I`` to add directories to search + for header files), these should be added to ``CFLAGS_USERMOD`` for C code + and to ``CXXFLAGS_USERMOD`` for C++ code. + +* ``micropython.cmake`` contains the CMake configuration for this module. + + In ``micropython.cmake``, you may use ``${CMAKE_CURRENT_LIST_DIR}`` as the path to + the current module. + + Your ``micropython.cmake`` should define an ``INTERFACE`` library and associate + your source files, compile definitions and include directories with it. + The library should then be linked to the ``usermod`` target. + + .. code-block:: cmake + + add_library(usermod_cexample INTERFACE) + + target_sources(usermod_cexample INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/examplemodule.c + ) + + target_include_directories(usermod_cexample INTERFACE + ${CMAKE_CURRENT_LIST_DIR} + ) + + target_link_libraries(usermod INTERFACE usermod_cexample) + + + See below for full usage example. + + +Basic example +------------- + +This simple module named ``cexample`` provides a single function +``cexample.add_ints(a, b)`` which adds the two integer args together and returns +the result. It can be found in the MicroPython source tree +`in the examples directory `_ +and has a source file and a Makefile fragment with content as described above:: + + micropython/ + └──examples/ + └──usercmodule/ + └──cexample/ + ├── examplemodule.c + ├── micropython.mk + └── micropython.cmake + + +Refer to the comments in these files for additional explanation. +Next to the ``cexample`` module there's also ``cppexample`` which +works in the same way but shows one way of mixing C and C++ code +in MicroPython. + + +Compiling the cmodule into MicroPython +-------------------------------------- + +To build such a module, compile MicroPython (see `getting started +`_), +applying 2 modifications: + +1. Set the build-time flag ``USER_C_MODULES`` to point to the modules + you want to include. For ports that use Make this variable should be a + directory which is searched automatically for modules. For ports that + use CMake this variable should be a file which includes the modules to + build. See below for details. + +2. Enable the modules by setting the corresponding C preprocessor macro to + 1. This is only needed if the modules you are building are not + automatically enabled. + +For building the example modules which come with MicroPython, +set ``USER_C_MODULES`` to the ``examples/usercmodule`` directory for Make, +or to ``examples/usercmodule/micropython.cmake`` for CMake. + +For example, here's how the to build the unix port with the example modules: + +.. code-block:: bash + + cd micropython/ports/unix + make USER_C_MODULES=../../examples/usercmodule + +You may need to run ``make clean`` once at the start when including new +user modules in the build. The build output will show the modules found:: + + ... + Including User C Module from ../../examples/usercmodule/cexample + Including User C Module from ../../examples/usercmodule/cppexample + ... + +For a CMake-based port such as rp2, this will look a little different (note +that CMake is actually invoked by ``make``): + +.. code-block:: bash + + cd micropython/ports/rp2 + make USER_C_MODULES=../../examples/usercmodule/micropython.cmake + +Again, you may need to run ``make clean`` first for CMake to pick up the +user modules. The CMake build output lists the modules by name:: + + ... + Including User C Module(s) from ../../examples/usercmodule/micropython.cmake + Found User C Module(s): usermod_cexample, usermod_cppexample + ... + +The contents of the top-level ``micropython.cmake`` can be used to control which +modules are enabled. + +For your own projects it's more convenient to keep custom code out of the main +MicroPython source tree, so a typical project directory structure will look +like this:: + + my_project/ + ├── modules/ + │ ├── example1/ + │ │ ├── example1.c + │ │ ├── micropython.mk + │ │ └── micropython.cmake + │ ├── example2/ + │ │ ├── example2.c + │ │ ├── micropython.mk + │ │ └── micropython.cmake + │ └── micropython.cmake + └── micropython/ + ├──ports/ + ... ├──stm32/ + ... + +When building with Make set ``USER_C_MODULES`` to the ``my_project/modules`` +directory. For example, building the stm32 port: + +.. code-block:: bash + + cd my_project/micropython/ports/stm32 + make USER_C_MODULES=../../../modules + +When building with CMake the top level ``micropython.cmake`` -- found directly +in the ``my_project/modules`` directory -- should ``include`` all of the modules +you want to have available: + + .. code-block:: cmake + + include(${CMAKE_CURRENT_LIST_DIR}/example1/micropython.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/example2/micropython.cmake) + +Then build with: + +.. code-block:: bash + + cd my_project/micropython/ports/esp32 + make USER_C_MODULES=../../../../modules/micropython.cmake + +Note that the esp32 port needs the extra ``..`` for relative paths due to the +location of its main ``CMakeLists.txt`` file. You can also specify absolute +paths to ``USER_C_MODULES``. + +All modules specified by the ``USER_C_MODULES`` variable (either found in this +directory when using Make, or added via ``include`` when using CMake) will be +compiled, but only those which are enabled will be available for importing. +User modules are usually enabled by default (this is decided by the developer +of the module), in which case there is nothing more to do than set ``USER_C_MODULES`` +as described above. + +If a module is not enabled by default then the corresponding C preprocessor macro +must be enabled. This macro name can be found by searching for the ``MP_REGISTER_MODULE`` +line in the module's source code (it usually appears at the end of the main source file). +This macro should be surrounded by a ``#if X`` / ``#endif`` pair, and the configuration +option ``X`` must be set to 1 using ``CFLAGS_EXTRA`` to make the module available. If +there is no ``#if X`` / ``#endif`` pair then the module is enabled by default. + +For example, the ``examples/usercmodule/cexample`` module is enabled by default so +has the following line in its source code: + + .. code-block:: c + + MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule); + +Alternatively, to make this module disabled by default but selectable through +a preprocessor configuration option, it would be: + + .. code-block:: c + + #if MODULE_CEXAMPLE_ENABLED + MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule); + #endif + +In this case the module is enabled by adding ``CFLAGS_EXTRA=-DMODULE_CEXAMPLE_ENABLED=1`` +to the ``make`` command, or editing ``mpconfigport.h`` or ``mpconfigboard.h`` to add + + .. code-block:: c + + #define MODULE_CEXAMPLE_ENABLED (1) + +Note that the exact method depends on the port as they have different +structures. If not done correctly it will compile but importing will +fail to find the module. + + +Module usage in MicroPython +--------------------------- + +Once built into your copy of MicroPython, the module +can now be accessed in Python just like any other builtin module, e.g. + +.. code-block:: python + + import cexample + print(cexample.add_ints(1, 3)) + # should display 4 diff --git a/components/language/micropython/docs/develop/compiler.rst b/components/language/micropython/docs/develop/compiler.rst new file mode 100644 index 00000000..20076574 --- /dev/null +++ b/components/language/micropython/docs/develop/compiler.rst @@ -0,0 +1,317 @@ +.. _compiler: + +The Compiler +============ + +The compilation process in MicroPython involves the following steps: + +* The lexer converts the stream of text that makes up a MicroPython program into tokens. +* The parser then converts the tokens into an abstract syntax (parse tree). +* Then bytecode or native code is emitted based on the parse tree. + +For purposes of this discussion we are going to add a simple language feature ``add1`` +that can be use in Python as: + +.. code-block:: bash + + >>> add1 3 + 4 + >>> + +The ``add1`` statement takes an integer as argument and adds ``1`` to it. + +Adding a grammar rule +---------------------- + +MicroPython's grammar is based on the `CPython grammar `_ +and is defined in `py/grammar.h `_. +This grammar is what is used to parse MicroPython source files. + +There are two macros you need to know to define a grammar rule: ``DEF_RULE`` and ``DEF_RULE_NC``. +``DEF_RULE`` allows you to define a rule with an associated compile function, +while ``DEF_RULE_NC`` has no compile (NC) function for it. + +A simple grammar definition with a compile function for our new ``add1`` statement +looks like the following: + +.. code-block:: c + + DEF_RULE(add1_stmt, c(add1_stmt), and(2), tok(KW_ADD1), rule(testlist)) + +The second argument ``c(add1_stmt)`` is the corresponding compile function that should be implemented +in ``py/compile.c`` to turn this rule into executable code. + +The third required argument can be ``or`` or ``and``. This specifies the number of nodes associated +with a statement. For example, in this case, our ``add1`` statement is similar to ADD1 in assembly +language. It takes one numeric argument. Therefore, the ``add1_stmt`` has two nodes associated with it. +One node is for the statement itself, i.e the literal ``add1`` corresponding to ``KW_ADD1``, +and the other for its argument, a ``testlist`` rule which is the top-level expression rule. + +.. note:: + The ``add1`` rule here is just an example and not part of the standard + MicroPython grammar. + +The fourth argument in this example is the token associated with the rule, ``KW_ADD1``. This token should be +defined in the lexer by editing ``py/lexer.h``. + +Defining the same rule without a compile function is achieved by using the ``DEF_RULE_NC`` macro +and omitting the compile function argument: + +.. code-block:: c + + DEF_RULE_NC(add1_stmt, and(2), tok(KW_ADD1), rule(testlist)) + +The remaining arguments take on the same meaning. A rule without a compile function must +be handled explicitly by all rules that may have this rule as a node. Such NC-rules are usually +used to express sub-parts of a complicated grammar structure that cannot be expressed in a +single rule. + +.. note:: + The macros ``DEF_RULE`` and ``DEF_RULE_NC`` take other arguments. For an in-depth understanding of + supported parameters, see `py/grammar.h `_. + +Adding a lexical token +---------------------- + +Every rule defined in the grammar should have a token associated with it that is defined in ``py/lexer.h``. +Add this token by editing the ``_mp_token_kind_t`` enum: + +.. code-block:: c + :emphasize-lines: 12 + + typedef enum _mp_token_kind_t { + ... + MP_TOKEN_KW_OR, + MP_TOKEN_KW_PASS, + MP_TOKEN_KW_RAISE, + MP_TOKEN_KW_RETURN, + MP_TOKEN_KW_TRY, + MP_TOKEN_KW_WHILE, + MP_TOKEN_KW_WITH, + MP_TOKEN_KW_YIELD, + MP_TOKEN_KW_ADD1, + ... + } mp_token_kind_t; + +Then also edit ``py/lexer.c`` to add the new keyword literal text: + +.. code-block:: c + :emphasize-lines: 12 + + STATIC const char *const tok_kw[] = { + ... + "or", + "pass", + "raise", + "return", + "try", + "while", + "with", + "yield", + "add1", + ... + }; + +Notice the keyword is named depending on what you want it to be. For consistency, maintain the +naming standard accordingly. + +.. note:: + The order of these keywords in ``py/lexer.c`` must match the order of tokens in the enum + defined in ``py/lexer.h``. + +Parsing +------- + +In the parsing stage the parser takes the tokens produced by the lexer and converts them to an abstract syntax tree (AST) or +*parse tree*. The implementation for the parser is defined in `py/parse.c `_. + +The parser also maintains a table of constants for use in different aspects of parsing, similar to what a +`symbol table `_ +does. + +Several optimizations like `constant folding `_ +on integers for most operations e.g. logical, binary, unary, etc, and optimizing enhancements on parenthesis +around expressions are performed during this phase, along with some optimizations on strings. + +It's worth noting that *docstrings* are discarded and not accessible to the compiler. +Even optimizations like `string interning `_ are +not applied to *docstrings*. + +Compiler passes +--------------- + +Like many compilers, MicroPython compiles all code to MicroPython bytecode or native code. The functionality +that achieves this is implemented in `py/compile.c `_. +The most relevant method you should know about is this: + +.. code-block:: c + + mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, bool is_repl) { + // Compile the input parse_tree to a raw-code structure. + mp_raw_code_t *rc = mp_compile_to_raw_code(parse_tree, source_file, is_repl); + // Create and return a function object that executes the outer module. + return mp_make_function_from_raw_code(rc, MP_OBJ_NULL, MP_OBJ_NULL); + } + +The compiler compiles the code in four passes: scope, stack size, code size and emit. +Each pass runs the same C code over the same AST data structure, with different things +being computed each time based on the results of the previous pass. + +First pass +~~~~~~~~~~ + +In the first pass, the compiler learns about the known identifiers (variables) and +their scope, being global, local, closed over, etc. In the same pass the emitter +(bytecode or native code) also computes the number of labels needed for the emitted +code. + +.. code-block:: c + + // Compile pass 1. + comp->emit = emit_bc; + comp->emit_method_table = &emit_bc_method_table; + + uint max_num_labels = 0; + for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) { + if (s->emit_options == MP_EMIT_OPT_ASM) { + compile_scope_inline_asm(comp, s, MP_PASS_SCOPE); + } else { + compile_scope(comp, s, MP_PASS_SCOPE); + + // Check if any implicitly declared variables should be closed over. + for (size_t i = 0; i < s->id_info_len; ++i) { + id_info_t *id = &s->id_info[i]; + if (id->kind == ID_INFO_KIND_GLOBAL_IMPLICIT) { + scope_check_to_close_over(s, id); + } + } + } + ... + } + +Second and third passes +~~~~~~~~~~~~~~~~~~~~~~~ + +The second and third passes involve computing the Python stack size and code size +for the bytecode or native code. After the third pass the code size cannot change, +otherwise jump labels will be incorrect. + +.. code-block:: c + + for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) { + ... + + // Pass 2: Compute the Python stack size. + compile_scope(comp, s, MP_PASS_STACK_SIZE); + + // Pass 3: Compute the code size. + if (comp->compile_error == MP_OBJ_NULL) { + compile_scope(comp, s, MP_PASS_CODE_SIZE); + } + + ... + } + +Just before pass two there is a selection for the type of code to be emitted, which can +either be native or bytecode. + +.. code-block:: c + + // Choose the emitter type. + switch (s->emit_options) { + case MP_EMIT_OPT_NATIVE_PYTHON: + case MP_EMIT_OPT_VIPER: + if (emit_native == NULL) { + emit_native = NATIVE_EMITTER(new)(&comp->compile_error, &comp->next_label, max_num_labels); + } + comp->emit_method_table = NATIVE_EMITTER_TABLE; + comp->emit = emit_native; + break; + + default: + comp->emit = emit_bc; + comp->emit_method_table = &emit_bc_method_table; + break; + } + +The bytecode option is the default but something unique to note for the native +code option is that there is another option via ``VIPER``. See the +:ref:`Emitting native code ` section for more details on +viper annotations. + +There is also support for *inline assembly code*, where assembly instructions are +written as Python function calls but are emitted directly as the corresponding +machine code. This assembler has only three passes (scope, code size, emit) +and uses a different implementation, not the ``compile_scope`` function. +See the `inline assembler tutorial `_ +for more details. + +Fourth pass +~~~~~~~~~~~ + +The fourth pass emits the final code that can be executed, either bytecode in +the virtual machine, or native code directly by the CPU. + +.. code-block:: c + + for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) { + ... + + // Pass 4: Emit the compiled bytecode or native code. + if (comp->compile_error == MP_OBJ_NULL) { + compile_scope(comp, s, MP_PASS_EMIT); + } + } + +Emitting bytecode +----------------- + +Statements in Python code usually correspond to emitted bytecode, for example ``a + b`` +generates "push a" then "push b" then "binary op add". Some statements do not emit +anything but instead affect other things like the scope of variables, for example +``global a``. + +The implementation of a function that emits bytecode looks similar to this: + +.. code-block:: c + + void mp_emit_bc_unary_op(emit_t *emit, mp_unary_op_t op) { + emit_write_bytecode_byte(emit, 0, MP_BC_UNARY_OP_MULTI + op); + } + +We use the unary operator expressions for an example here but the implementation +details are similar for other statements/expressions. The method ``emit_write_bytecode_byte()`` +is a wrapper around the main function ``emit_get_cur_to_write_bytecode()`` that all +functions must call to emit bytecode. + +.. _emitting_native_code: + +Emitting native code +--------------------- + +Similar to how bytecode is generated, there should be a corresponding function in ``py/emitnative.c`` for each +code statement: + +.. code-block:: c + + STATIC void emit_native_unary_op(emit_t *emit, mp_unary_op_t op) { + vtype_kind_t vtype; + emit_pre_pop_reg(emit, &vtype, REG_ARG_2); + if (vtype == VTYPE_PYOBJ) { + emit_call_with_imm_arg(emit, MP_F_UNARY_OP, op, REG_ARG_1); + emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET); + } else { + adjust_stack(emit, 1); + EMIT_NATIVE_VIPER_TYPE_ERROR(emit, + MP_ERROR_TEXT("unary op %q not implemented"), mp_unary_op_method_name[op]); + } + } + +The difference here is that we have to handle *viper typing*. Viper annotations allow +us to handle more than one type of variable. By default all variables are Python objects, +but with viper a variable can also be declared as a machine-typed variable like a native +integer or pointer. Viper can be thought of as a superset of Python, where normal Python +objects are handled as usual, while native machine variables are handled in an optimised +way by using direct machine instructions for the operations. Viper typing may break +Python equivalence because, for example, integers become native integers and can overflow +(unlike Python integers which extend automatically to arbitrary precision). diff --git a/components/language/micropython/docs/develop/extendingmicropython.rst b/components/language/micropython/docs/develop/extendingmicropython.rst new file mode 100644 index 00000000..b4029c42 --- /dev/null +++ b/components/language/micropython/docs/develop/extendingmicropython.rst @@ -0,0 +1,18 @@ +.. _extendingmicropython: + +Extending MicroPython in C +========================== + +This chapter describes options for implementing additional functionality in C, but from code +written outside of the main MicroPython repository. The first approach is useful for building +your own custom firmware with some project-specific additional modules or functions that can +be accessed from Python. The second approach is for building modules that can be loaded at runtime. + +Please see the :ref:`library section ` for more information on building core modules that +live in the main MicroPython repository. + +.. toctree:: + :maxdepth: 3 + + cmodules.rst + natmod.rst diff --git a/components/language/micropython/docs/develop/gettingstarted.rst b/components/language/micropython/docs/develop/gettingstarted.rst new file mode 100644 index 00000000..36062ddc --- /dev/null +++ b/components/language/micropython/docs/develop/gettingstarted.rst @@ -0,0 +1,329 @@ +.. _gettingstarted: + +Getting Started +=============== + +This guide covers a step-by-step process on setting up version control, obtaining and building +a copy of the source code for a port, building the documentation, running tests, and a description of the +directory structure of the MicroPython code base. + +Source control with git +----------------------- + +MicroPython is hosted on `GitHub `_ and uses +`Git `_ for source control. The workflow is such that +code is pulled and pushed to and from the main repository. Install the respective version +of Git for your operating system to follow through the rest of the steps. + +.. note:: + For a reference on the installation instructions, please refer to + the `Git installation instructions `_. + Learn about the basic git commands in this `Git Handbook `_ + or any other sources on the internet. + +.. note:: + A .git-blame-ignore-revs file is included which avoids the output of git blame getting cluttered + by commits which are only for formatting code but have no functional changes. See `git blame documentation + `_ on how to use this. + +Get the code +------------ + +It is recommended that you maintain a fork of the MicroPython repository for your development purposes. +The process of obtaining the source code includes the following: + +#. Fork the repository https://github.com/micropython/micropython +#. You will now have a fork at /micropython>. +#. Clone the forked repository using the following command: + +.. code-block:: bash + + $ git clone https://github.com//micropython + +Then, `configure the remote repositories `_ to be able to +collaborate on the MicroPython project. + +Configure remote upstream: + +.. code-block:: bash + + $ cd micropython + $ git remote add upstream https://github.com/micropython/micropython + +It is common to configure ``upstream`` and ``origin`` on a forked repository +to assist with sharing code changes. You can maintain your own mapping but +it is recommended that ``origin`` maps to your fork and ``upstream`` to the main +MicroPython repository. + +After the above configuration, your setup should be similar to this: + +.. code-block:: bash + + $ git remote -v + origin https://github.com//micropython (fetch) + origin https://github.com//micropython (push) + upstream https://github.com/micropython/micropython (fetch) + upstream https://github.com/micropython/micropython (push) + +You should now have a copy of the source code. By default, you are pointing +to the master branch. To prepare for further development, it is recommended +to work on a development branch. + +.. code-block:: bash + + $ git checkout -b dev-branch + +You can give it any name. You will have to compile MicroPython whenever you change +to a different branch. + +Compile and build the code +-------------------------- + +When compiling MicroPython, you compile a specific :term:`port`, usually +targeting a specific :ref:`board `. Start by installing the required dependencies. +Then build the MicroPython cross-compiler before you can successfully compile and build. +This applies specifically when using Linux to compile. +The Windows instructions are provided in a later section. + +.. _required_dependencies: + +Required dependencies +~~~~~~~~~~~~~~~~~~~~~ + +Install the required dependencies for Linux: + +.. code-block:: bash + + $ sudo apt-get install build-essential libffi-dev git pkg-config + +For the stm32 port, the ARM cross-compiler is required: + +.. code-block:: bash + + $ sudo apt-get install arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib + +See the `ARM GCC +toolchain `_ +for the latest details. + +Python is also required. Python 2 is supported for now, but we recommend using Python 3. +Check that you have Python available on your system: + +.. code-block:: bash + + $ python3 + Python 3.5.0 (default, Jul 17 2020, 14:04:10) + [GCC 5.4.0 20160609] on linux + Type "help", "copyright", "credits" or "license" for more information. + >>> + +All supported ports have different dependency requirements, see their respective +`readme files `_. + +Building the MicroPython cross-compiler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Almost all ports require building ``mpy-cross`` first to perform pre-compilation +of Python code that will be included in the port firmware: + +.. code-block:: bash + + $ cd mpy-cross + $ make + +.. note:: + Note that, ``mpy-cross`` must be built for the host architecture + and not the target architecture. + +If it built successfully, you should see a message similar to this: + +.. code-block:: bash + + LINK mpy-cross + text data bss dec hex filename + 279328 776 880 280984 44998 mpy-cross + +.. note:: + + Use ``make -C mpy-cross`` to build the cross-compiler in one statement + without moving to the ``mpy-cross`` directory otherwise, you will need + to do ``cd ..`` for the next steps. + +Building the Unix port of MicroPython +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Unix port is a version of MicroPython that runs on Linux, macOS, and other Unix-like operating systems. +It's extremely useful for developing MicroPython as it avoids having to deploy your code to a device to test it. +In many ways, it works a lot like CPython's python binary. + +To build for the Unix port, make sure all Linux related dependencies are installed as detailed in the +required dependencies section. See the :ref:`required_dependencies` +to make sure that all dependencies are installed for this port. Also, make sure you have a working +environment for ``gcc`` and ``GNU make``. Ubuntu 20.04 has been used for the example +below but other unixes ought to work with little modification: + +.. code-block:: bash + + $ gcc --version + gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0 + Copyright (C) 2019 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.then build: + +.. code-block:: bash + + $ cd ports/unix + $ make submodules + $ make + +If MicroPython built correctly, you should see the following: + +.. code-block:: bash + + LINK micropython + text data bss dec hex filename + 412033 5680 2496 420209 66971 micropython + +Now run it: + +.. code-block:: bash + + $ ./micropython + MicroPython v1.13-38-gc67012d-dirty on 2020-09-13; linux version + Use Ctrl-D to exit, Ctrl-E for paste mode + >>> print("hello world") + hello world + >>> + +Building the Windows port +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Windows port includes a Visual Studio project file micropython.vcxproj that you can use to build micropython.exe. +It can be opened in Visual Studio or built from the command line using msbuild. Alternatively, it can be built using mingw, +either in Windows with Cygwin, or on Linux. +See `windows port documentation `_ for more information. + +Building the STM32 port +~~~~~~~~~~~~~~~~~~~~~~~ + +Like the Unix port, you need to install some required dependencies +as detailed in the :ref:`required_dependencies` section, then build: + +.. code-block:: bash + + $ cd ports/stm32 + $ make submodules + $ make + +Please refer to the `stm32 documentation `_ +for more details on flashing the firmware. + +.. note:: + See the :ref:`required_dependencies` to make sure that all dependencies are installed for this port. + The cross-compiler is needed. ``arm-none-eabi-gcc`` should also be in the $PATH or specified manually + via CROSS_COMPILE, either by setting the environment variable or in the ``make`` command line arguments. + +You can also specify which board to use: + +.. code-block:: bash + + $ cd ports/stm32 + $ make submodules + $ make BOARD= + +See `ports/stm32/boards `_ +for the available boards. e.g. "PYBV11" or "NUCLEO_WB55". + +Building the documentation +-------------------------- + +MicroPython documentation is created using ``Sphinx``. If you have already +installed Python, then install ``Sphinx`` using ``pip``. It is recommended +that you use a virtual environment: + +.. code-block:: bash + + $ python3 -m venv env + $ source env/bin/activate + $ pip install sphinx + +Navigate to the ``docs`` directory: + +.. code-block:: bash + + $ cd docs + +Build the docs: + +.. code-block:: bash + + $ make html + +Open ``docs/build/html/index.html`` in your browser to view the docs locally. Refer to the +documentation on `importing your documentation +`_ to use Read the Docs. + +Running the tests +----------------- + +To run all tests in the test suite on the Unix port use: + +.. code-block:: bash + + $ cd ports/unix + $ make test + +To run a selection of tests on a board/device connected over USB use: + +.. code-block:: bash + + $ cd tests + $ ./run-tests.py --target minimal --device /dev/ttyACM0 + +See also :ref:`writingtests`. + +Folder structure +---------------- + +There are a couple of directories to take note of in terms of where certain implementation details +are. The following is a break down of the top-level folders in the source code. + +py + + Contains the compiler, runtime, and core library implementation. + +mpy-cross + + Has the MicroPython cross-compiler which pre-compiles the Python scripts to bytecode. + +ports + + Code for all the versions of MicroPython for the supported ports. + +lib + + Low-level C libraries used by any port which are mostly 3rd-party libraries. + +drivers + + Has drivers for specific hardware and intended to work across multiple ports. + +extmod + + Contains a C implementation of more non-core modules. + +docs + + Has the standard documentation found at https://docs.micropython.org/. + +tests + + An implementation of the test suite. + +tools + + Contains helper tools including the ``upip`` and the ``pyboard.py`` module. + +examples + + Example code for building MicroPython as a library as well as native modules. diff --git a/components/language/micropython/docs/develop/img/bitmap.png b/components/language/micropython/docs/develop/img/bitmap.png new file mode 100644 index 00000000..87de81d7 Binary files /dev/null and b/components/language/micropython/docs/develop/img/bitmap.png differ diff --git a/components/language/micropython/docs/develop/img/collision.png b/components/language/micropython/docs/develop/img/collision.png new file mode 100644 index 00000000..a67ddd61 Binary files /dev/null and b/components/language/micropython/docs/develop/img/collision.png differ diff --git a/components/language/micropython/docs/develop/img/linprob.png b/components/language/micropython/docs/develop/img/linprob.png new file mode 100644 index 00000000..c2881890 Binary files /dev/null and b/components/language/micropython/docs/develop/img/linprob.png differ diff --git a/components/language/micropython/docs/develop/index.rst b/components/language/micropython/docs/develop/index.rst new file mode 100644 index 00000000..327038f1 --- /dev/null +++ b/components/language/micropython/docs/develop/index.rst @@ -0,0 +1,26 @@ +MicroPython Internals +===================== + +This chapter covers a tour of MicroPython from the perspective of a developer, contributing +to MicroPython. It acts as a comprehensive resource on the implementation details of MicroPython +for both novice and expert contributors. + +Development around MicroPython usually involves modifying the core runtime, porting or +maintaining a new library. This guide describes at great depth, the implementation +details of MicroPython including a getting started guide, compiler internals, porting +MicroPython to a new platform and implementing a core MicroPython library. + +.. toctree:: + :maxdepth: 3 + + gettingstarted.rst + writingtests.rst + compiler.rst + memorymgt.rst + library.rst + optimizations.rst + qstr.rst + maps.rst + publiccapi.rst + extendingmicropython.rst + porting.rst diff --git a/components/language/micropython/docs/develop/library.rst b/components/language/micropython/docs/develop/library.rst new file mode 100644 index 00000000..c2a86ea1 --- /dev/null +++ b/components/language/micropython/docs/develop/library.rst @@ -0,0 +1,86 @@ +.. _internals_library: + +Implementing a Module +===================== + +This chapter details how to implement a core module in MicroPython. +MicroPython modules can be one of the following: + +- Built-in module: A general module that is be part of the MicroPython repository. +- User module: A module that is useful for your specific project that you maintain + in your own repository or private codebase. +- Dynamic module: A module that can be deployed and imported at runtime to your device. + +A module in MicroPython can be implemented in one of the following locations: + +- py/: A core library that mirrors core CPython functionality. +- extmod/: A CPython or MicroPython-specific module that is shared across multiple ports. +- ports//: A port-specific module. + +.. note:: + This chapter describes modules implemented in ``py/`` or core modules. + See :ref:`extendingmicropython` for details on implementing an external module. + For details on port-specific modules, see :ref:`porting_to_a_board`. + +Implementing a core module +-------------------------- + +Like CPython, MicroPython has core builtin modules that can be accessed through import statements. +An example is the ``gc`` module discussed in :ref:`memorymanagement`. + +.. code-block:: bash + + >>> import gc + >>> gc.enable() + >>> + +MicroPython has several other builtin standard/core modules like ``io``, ``array`` etc. +Adding a new core module involves several modifications. + +First, create the ``C`` file in the ``py/`` directory. In this example we are adding a +hypothetical new module ``subsystem`` in the file ``modsubsystem.c``: + +.. code-block:: c + + #include "py/builtin.h" + #include "py/runtime.h" + + #if MICROPY_PY_SUBSYSTEM + + // info() + STATIC mp_obj_t py_subsystem_info(void) { + return MP_OBJ_NEW_SMALL_INT(42); + } + MP_DEFINE_CONST_FUN_OBJ_0(subsystem_info_obj, py_subsystem_info); + + STATIC const mp_rom_map_elem_t mp_module_subsystem_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_subsystem) }, + { MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&subsystem_info_obj) }, + }; + STATIC MP_DEFINE_CONST_DICT(mp_module_subsystem_globals, mp_module_subsystem_globals_table); + + const mp_obj_module_t mp_module_subsystem = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&mp_module_subsystem_globals, + }; + + MP_REGISTER_MODULE(MP_QSTR_subsystem, mp_module_subsystem); + + #endif + +The implementation includes a definition of all functions related to the module and adds the +functions to the module's global table in ``mp_module_subsystem_globals_table``. It also +creates the module object with ``mp_module_subsystem``. The module is then registered with +the wider system via the ``MP_REGISTER_MODULE`` macro. + +After building and running the modified MicroPython, the module should now be importable: + +.. code-block:: bash + + >>> import subsystem + >>> subsystem.info() + 42 + >>> + +Our ``info()`` function currently returns just a single number but can be extended +to do anything. Similarly, more functions can be added to this new module. diff --git a/components/language/micropython/docs/develop/maps.rst b/components/language/micropython/docs/develop/maps.rst new file mode 100644 index 00000000..8f899fa1 --- /dev/null +++ b/components/language/micropython/docs/develop/maps.rst @@ -0,0 +1,63 @@ +.. _maps: + +Maps and Dictionaries +===================== + +MicroPython dictionaries and maps use techniques called open addressing and linear probing. +This chapter details both of these methods. + +Open addressing +--------------- + +`Open addressing `_ is used to resolve collisions. +Collisions are very common occurrences and happen when two items happen to hash to the same +slot or location. For example, given a hash setup as this: + +.. image:: img/collision.png + +If there is a request to fill slot ``0`` with ``70``, since the slot ``0`` is not empty, open addressing +finds the next available slot in the dictionary to service this request. This sequential search for an alternate +location is called *probing*. There are several sequence probing algorithms but MicroPython uses +linear probing that is described in the next section. + +Linear probing +-------------- + +Linear probing is one of the methods for finding an available address or slot in a dictionary. In MicroPython, +it is used with open addressing. To service the request described above, unlike other probing algorithms, +linear probing assumes a fixed interval of ``1`` between probes. The request will therefore be serviced by +placing the item in the next free slot which is slot ``4`` in our example: + +.. image:: img/linprob.png + +The same methods i.e open addressing and linear probing are used to search for an item in a dictionary. +Assume we want to search for the data item ``33``. The computed hash value will be 2. Looking at slot 2 +reveals ``33``, at this point, we return ``True``. Searching for ``70`` is quite different as there was a +collision at the time of insertion. Therefore computing the hash value is ``0`` which is currently +holding ``44``. Instead of simply returning ``False``, we perform a sequential search starting at point +``1`` until the item ``70`` is found or we encounter a free slot. This is the general way of performing +look-ups in hashes: + +.. code-block:: c + + // not yet found, keep searching in this table + pos = (pos + 1) % set->alloc; + + if (pos == start_pos) { + // search got back to starting position, so index is not in table + if (lookup_kind & MP_MAP_LOOKUP_ADD_IF_NOT_FOUND) { + if (avail_slot != NULL) { + // there was an available slot, so use that + set->used++; + *avail_slot = index; + return index; + } else { + // not enough room in table, rehash it + mp_set_rehash(set); + // restart the search for the new element + start_pos = pos = hash % set->alloc; + } + } + } else { + return MP_OBJ_NULL; + } diff --git a/components/language/micropython/docs/develop/memorymgt.rst b/components/language/micropython/docs/develop/memorymgt.rst new file mode 100644 index 00000000..5b1690cc --- /dev/null +++ b/components/language/micropython/docs/develop/memorymgt.rst @@ -0,0 +1,141 @@ +.. _memorymanagement: + +Memory Management +================= + +Unlike programming languages such as C/C++, MicroPython hides memory management +details from the developer by supporting automatic memory management. +Automatic memory management is a technique used by operating systems or applications to automatically manage +the allocation and deallocation of memory. This eliminates challenges such as forgetting to +free the memory allocated to an object. Automatic memory management also avoids the critical issue of using memory +that is already released. Automatic memory management takes many forms, one of them being +garbage collection (GC). + +The garbage collector usually has two responsibilities; + +#. Allocate new objects in available memory. +#. Free unused memory. + +There are many GC algorithms but MicroPython uses the +`Mark and Sweep `_ +policy for managing memory. This algorithm has a mark phase that traverses the heap marking all +live objects while the sweep phase goes through the heap reclaiming all unmarked objects. + +Garbage collection functionality in MicroPython is available through the ``gc`` built-in +module: + +.. code-block:: bash + + >>> x = 5 + >>> x + 5 + >>> import gc + >>> gc.enable() + >>> gc.mem_alloc() + 1312 + >>> gc.mem_free() + 2071392 + >>> gc.collect() + 19 + >>> gc.disable() + >>> + +Even when ``gc.disable()`` is invoked, collection can be triggered with ``gc.collect()``. + +The object model +---------------- + +All MicroPython objects are referred to by the ``mp_obj_t`` data type. +This is usually word-sized (i.e. the same size as a pointer on the target architecture), +and can be typically 32-bit (STM32, nRF, ESP32, Unix x86) or 64-bit (Unix x64). +It can also be greater than a word-size for certain object representations, for +example ``OBJ_REPR_D`` has a 64-bit sized ``mp_obj_t`` on a 32-bit architecture. + +An ``mp_obj_t`` represents a MicroPython object, for example an integer, float, type, dict or +class instance. Some objects, like booleans and small integers, have their value stored directly +in the ``mp_obj_t`` value and do not require additional memory. Other objects have their value +store elsewhere in memory (for example on the garbage-collected heap) and their ``mp_obj_t`` contains +a pointer to that memory. A portion of ``mp_obj_t`` is the tag which tells what type of object it is. + +See ``py/mpconfig.h`` for the specific details of the available representations. + +**Pointer tagging** + +Because pointers are word-aligned, when they are stored in an ``mp_obj_t`` the +lower bits of this object handle will be zero. For example on a 32-bit architecture +the lower 2 bits will be zero: + +``********|********|********|******00`` + +These bits are reserved for purposes of storing a tag. The tag stores extra information as +opposed to introducing a new field to store that information in the object, which may be +inefficient. In MicroPython the tag tells if we are dealing with a small integer, interned +(small) string or a concrete object, and different semantics apply to each of these. + +For small integers the mapping is this: + +``********|********|********|*******1`` + +Where the asterisks hold the actual integer value. For an interned string or an immediate +object (e.g. ``True``) the layout of the ``mp_obj_t`` value is, respectively: + +``********|********|********|*****010`` + +``********|********|********|*****110`` + +While a concrete object that is none of the above takes the form: + +``********|********|********|******00`` + +The stars here correspond to the address of the concrete object in memory. + +Allocation of objects +---------------------- + +The value of a small integer is stored directly in the ``mp_obj_t`` and will be +allocated in-place, not on the heap or elsewhere. As such, creation of small +integers does not affect the heap. Similarly for interned strings that already have +their textual data stored elsewhere, and immediate values like ``None``, ``False`` +and ``True``. + +Everything else which is a concrete object is allocated on the heap and its object structure is such that +a field is reserved in the object header to store the type of the object. + +.. code-block:: bash + + +++++++++++ + + + + + type + object header + + + + +++++++++++ + + + object items + + + + + + + +++++++++++ + +The heap's smallest unit of allocation is a block, which is four machine words in +size (16 bytes on a 32-bit machine, 32 bytes on a 64-bit machine). +Another structure also allocated on the heap tracks the allocation of +objects in each block. This structure is called a *bitmap*. + +.. image:: img/bitmap.png + +The bitmap tracks whether a block is "free" or "in use" and use two bits to track this state +for each block. + +The mark-sweep garbage collector manages the objects allocated on the heap, and also +utilises the bitmap to mark objects that are still in use. +See `py/gc.c `_ +for the full implementation of these details. + +**Allocation: heap layout** + +The heap is arranged such that it consists of blocks in pools. A block +can have different properties: + +- *ATB(allocation table byte):* If set, then the block is a normal block +- *FREE:* Free block +- *HEAD:* Head of a chain of blocks +- *TAIL:* In the tail of a chain of blocks +- *MARK :* Marked head block +- *FTB(finaliser table byte):* If set, then the block has a finaliser diff --git a/components/language/micropython/docs/develop/natmod.rst b/components/language/micropython/docs/develop/natmod.rst new file mode 100644 index 00000000..6d15f867 --- /dev/null +++ b/components/language/micropython/docs/develop/natmod.rst @@ -0,0 +1,225 @@ +.. _natmod: + +Native machine code in .mpy files +================================= + +This section describes how to build and work with .mpy files that contain native +machine code from a language other than Python. This allows you to +write code in a language like C, compile and link it into a .mpy file, and then +import this file like a normal Python module. This can be used for implementing +functionality which is performance critical, or for including an existing +library written in another language. + +One of the main advantages of using native .mpy files is that native machine code +can be imported by a script dynamically, without the need to rebuild the main +MicroPython firmware. This is in contrast to :ref:`cmodules` which also allows +defining custom modules in C but they must be compiled into the main firmware image. + +The focus here is on using C to build native modules, but in principle any +language which can be compiled to stand-alone machine code can be put into a +.mpy file. + +A native .mpy module is built using the ``mpy_ld.py`` tool, which is found in the +``tools/`` directory of the project. This tool takes a set of object files +(.o files) and links them together to create a native .mpy files. It requires +CPython 3 and the library pyelftools v0.25 or greater. + +Supported features and limitations +---------------------------------- + +A .mpy file can contain MicroPython bytecode and/or native machine code. If it +contains native machine code then the .mpy file has a specific architecture +associated with it. Current supported architectures are (these are the valid +options for the ``ARCH`` variable, see below): + +* ``x86`` (32 bit) +* ``x64`` (64 bit x86) +* ``armv6m`` (ARM Thumb, eg Cortex-M0) +* ``armv7m`` (ARM Thumb 2, eg Cortex-M3) +* ``armv7emsp`` (ARM Thumb 2, single precision float, eg Cortex-M4F, Cortex-M7) +* ``armv7emdp`` (ARM Thumb 2, double precision float, eg Cortex-M7) +* ``xtensa`` (non-windowed, eg ESP8266) +* ``xtensawin`` (windowed with window size 8, eg ESP32) + +When compiling and linking the native .mpy file the architecture must be chosen +and the corresponding file can only be imported on that architecture. For more +details about .mpy files see :ref:`mpy_files`. + +Native code must be compiled as position independent code (PIC) and use a global +offset table (GOT), although the details of this varies from architecture to +architecture. When importing .mpy files with native code the import machinery +is able to do some basic relocation of the native code. This includes +relocating text, rodata and BSS sections. + +Supported features of the linker and dynamic loader are: + +* executable code (text) +* read-only data (rodata), including strings and constant data (arrays, structs, etc) +* zeroed data (BSS) +* pointers in text to text, rodata and BSS +* pointers in rodata to text, rodata and BSS + +The known limitations are: + +* data sections are not supported; workaround: use BSS data and initialise the + data values explicitly + +* static BSS variables are not supported; workaround: use global BSS variables + +So, if your C code has writable data, make sure the data is defined globally, +without an initialiser, and only written to within functions. + +Linker limitation: the native module is not linked against the symbol table of the +full MicroPython firmware. Rather, it is linked against an explicit table of exported +symbols found in ``mp_fun_table`` (in ``py/nativeglue.h``), that is fixed at firmware +build time. It is thus not possible to simply call some arbitrary HAL/OS/RTOS/system +function, for example. + +New symbols can be added to the end of the table and the firmware rebuilt. +The symbols also need to be added to ``tools/mpy_ld.py``'s ``fun_table`` dict in the +same location. This allows ``mpy_ld.py`` to be able to pick the new symbols up and +provide relocations for them when the mpy is imported. Finally, if the symbol is a +function, a macro or stub should be added to ``py/dynruntime.h`` to make it easy to +call the function. + +Defining a native module +------------------------ + +A native .mpy module is defined by a set of files that are used to build the .mpy. +The filesystem layout consists of two main parts, the source files and the Makefile: + +* In the simplest case only a single C source file is required, which contains all + the code that will be compiled into the .mpy module. This C source code must + include the ``py/dynruntime.h`` file to access the MicroPython dynamic API, and + must at least define a function called ``mpy_init``. This function will be the + entry point of the module, called when the module is imported. + + The module can be split into multiple C source files if desired. Parts of the + module can also be implemented in Python. All source files should be listed in + the Makefile, by adding them to the ``SRC`` variable (see below). This includes + both C source files as well as any Python files which will be included in the + resulting .mpy file. + +* The ``Makefile`` contains the build configuration for the module and list the + source files used to build the .mpy module. It should define ``MPY_DIR`` as the + location of the MicroPython repository (to find header files, the relevant Makefile + fragment, and the ``mpy_ld.py`` tool), ``MOD`` as the name of the module, ``SRC`` + as the list of source files, optionally specify the machine architecture via ``ARCH``, + and then include ``py/dynruntime.mk``. + +Minimal example +--------------- + +This section provides a fully working example of a simple module named ``factorial``. +This module provides a single function ``factorial.factorial(x)`` which computes the +factorial of the input and returns the result. + +Directory layout:: + + factorial/ + ├── factorial.c + └── Makefile + +The file ``factorial.c`` contains: + +.. code-block:: c + + // Include the header file to get access to the MicroPython API + #include "py/dynruntime.h" + + // Helper function to compute factorial + STATIC mp_int_t factorial_helper(mp_int_t x) { + if (x == 0) { + return 1; + } + return x * factorial_helper(x - 1); + } + + // This is the function which will be called from Python, as factorial(x) + STATIC mp_obj_t factorial(mp_obj_t x_obj) { + // Extract the integer from the MicroPython input object + mp_int_t x = mp_obj_get_int(x_obj); + // Calculate the factorial + mp_int_t result = factorial_helper(x); + // Convert the result to a MicroPython integer object and return it + return mp_obj_new_int(result); + } + // Define a Python reference to the function above + STATIC MP_DEFINE_CONST_FUN_OBJ_1(factorial_obj, factorial); + + // This is the entry point and is called when the module is imported + mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *args) { + // This must be first, it sets up the globals dict and other things + MP_DYNRUNTIME_INIT_ENTRY + + // Make the function available in the module's namespace + mp_store_global(MP_QSTR_factorial, MP_OBJ_FROM_PTR(&factorial_obj)); + + // This must be last, it restores the globals dict + MP_DYNRUNTIME_INIT_EXIT + } + +The file ``Makefile`` contains: + +.. code-block:: make + + # Location of top-level MicroPython directory + MPY_DIR = ../../.. + + # Name of module + MOD = factorial + + # Source files (.c or .py) + SRC = factorial.c + + # Architecture to build for (x86, x64, armv6m, armv7m, xtensa, xtensawin) + ARCH = x64 + + # Include to get the rules for compiling and linking the module + include $(MPY_DIR)/py/dynruntime.mk + +Compiling the module +-------------------- + +The prerequisite tools needed to build a native .mpy file are: + +* The MicroPython repository (at least the ``py/`` and ``tools/`` directories). +* CPython 3, and the library pyelftools (eg ``pip install 'pyelftools>=0.25'``). +* GNU make. +* A C compiler for the target architecture (if C source is used). +* Optionally ``mpy-cross``, built from the MicroPython repository (if .py source is used). + +Be sure to select the correct ``ARCH`` for the target you are going to run on. +Then build with:: + + $ make + +Without modifying the Makefile you can specify the target architecture via:: + + $ make ARCH=armv7m + +Module usage in MicroPython +--------------------------- + +Once the module is built there should be a file called ``factorial.mpy``. Copy +this so it is accessible on the filesystem of your MicroPython system and can be +found in the import path. The module can now be accessed in Python just like any +other module, for example:: + + import factorial + print(factorial.factorial(10)) + # should display 3628800 + +Further examples +---------------- + +See ``examples/natmod/`` for further examples which show many of the available +features of native .mpy modules. Such features include: + +* using multiple C source files +* including Python code alongside C code +* rodata and BSS data +* memory allocation +* use of floating point +* exception handling +* including external C libraries diff --git a/components/language/micropython/docs/develop/optimizations.rst b/components/language/micropython/docs/develop/optimizations.rst new file mode 100644 index 00000000..d972cde6 --- /dev/null +++ b/components/language/micropython/docs/develop/optimizations.rst @@ -0,0 +1,72 @@ +.. _optimizations: + +Optimizations +============= + +MicroPython uses several optimizations to save RAM but also ensure the efficient +execution of programs. This chapter discusses some of these optimizations. + +.. note:: + :ref:`qstr` and :ref:`maps` details other optimizations on strings and + dictionaries. + +Frozen bytecode +--------------- + +When MicroPython loads Python code from the filesystem, it first has to parse the file into +a temporary in-memory representation, and then generate bytecode for execution, both of which +are stored in the heap (in RAM). This can lead to significant amounts of memory being used. +The MicroPython cross compiler can be used to generate +a ``.mpy`` file, containing the pre-compiled bytecode for a Python module. This will still +be loaded into RAM, but it avoids the additional overhead of the parsing stage. + +As a further optimisation, the pre-compiled bytecode from a ``.mpy`` file can be "frozen" +into the firmware image as part of the main firmware compilation process, which means that +the bytecode will be executed from ROM. This can lead to a significant memory saving, and +reduce heap fragmentation. + +Variables +--------- + +MicroPython processes local and global variables differently. Global variables +are stored and looked up from a global dictionary that is allocated on the heap +(note that each module has its own separate dict, so separate namespace). +Local variables on the other hand are are stored on the Python value stack, which may +live on the C stack or on the heap. They are accessed directly by their offset +within the Python stack, which is more efficient than a global lookup in a dict. + +The length of global variable names also affects how much RAM is used as identifiers +are stored in RAM. The shorter the identifier, the less memory is used. + +The other aspect is that ``const`` variables that start with an underscore are treated as +proper constants and are not allocated or added in a dictionary, hence saving some memory. +These variables use ``const()`` from the MicroPython library. Therefore: + +.. code-block:: python + + from micropython import const + + X = const(1) + _Y = const(2) + foo(X, _Y) + +Compiles to: + +.. code-block:: python + + X = 1 + foo(1, 2) + +Allocation of memory +-------------------- + +Most of the common MicroPython constructs are not allocated on the heap. +However the following are: + +- Dynamic data structures like lists, mappings, etc; +- Functions, classes and object instances; +- imports; and +- First-time assignment of global variables (to create the slot in the global dict). + +For a detailed discussion on a more user-centric perspective on optimization, +see `Maximising MicroPython speed `_ diff --git a/components/language/micropython/docs/develop/porting.rst b/components/language/micropython/docs/develop/porting.rst new file mode 100644 index 00000000..bc25f47e --- /dev/null +++ b/components/language/micropython/docs/develop/porting.rst @@ -0,0 +1,306 @@ +.. _porting_to_a_board: + +Porting MicroPython +=================== + +The MicroPython project contains several ports to different microcontroller families and +architectures. The project repository has a `ports `_ +directory containing a subdirectory for each supported port. + +A port will typically contain definitions for multiple "boards", each of which is a specific piece of +hardware that that port can run on, e.g. a development kit or device. + +The `minimal port `_ is +available as a simplified reference implementation of a MicroPython port. It can run on both the +host system and an STM32F4xx MCU. + +In general, starting a port requires: + +- Setting up the toolchain (configuring Makefiles, etc). +- Implementing boot configuration and CPU initialization. +- Initialising basic drivers required for development and debugging (e.g. GPIO, UART). +- Performing the board-specific configurations. +- Implementing the port-specific modules. + +Minimal MicroPython firmware +---------------------------- + +The best way to start porting MicroPython to a new board is by integrating a minimal +MicroPython interpreter. For this walkthrough, create a subdirectory for the new +port in the ``ports`` directory: + +.. code-block:: bash + + $ cd ports + $ mkdir example_port + +The basic MicroPython firmware is implemented in the main port file, e.g ``main.c``: + +.. code-block:: c + + #include "py/compile.h" + #include "py/gc.h" + #include "py/mperrno.h" + #include "py/stackctrl.h" + #include "shared/runtime/gchelper.h" + #include "shared/runtime/pyexec.h" + + // Allocate memory for the MicroPython GC heap. + static char heap[4096]; + + int main(int argc, char **argv) { + // Initialise the MicroPython runtime. + mp_stack_ctrl_init(); + gc_init(heap, heap + sizeof(heap)); + mp_init(); + + // Start a normal REPL; will exit when ctrl-D is entered on a blank line. + pyexec_friendly_repl(); + + // Deinitialise the runtime. + gc_sweep_all(); + mp_deinit(); + return 0; + } + + // Handle uncaught exceptions (should never be reached in a correct C implementation). + void nlr_jump_fail(void *val) { + for (;;) { + } + } + + // Do a garbage collection cycle. + void gc_collect(void) { + gc_collect_start(); + gc_helper_collect_regs_and_stack(); + gc_collect_end(); + } + + // There is no filesystem so stat'ing returns nothing. + mp_import_stat_t mp_import_stat(const char *path) { + return MP_IMPORT_STAT_NO_EXIST; + } + + // There is no filesystem so opening a file raises an exception. + mp_lexer_t *mp_lexer_new_from_file(const char *filename) { + mp_raise_OSError(MP_ENOENT); + } + +We also need a Makefile at this point for the port: + +.. code-block:: Makefile + + # Include the core environment definitions; this will set $(TOP). + include ../../py/mkenv.mk + + # Include py core make definitions. + include $(TOP)/py/py.mk + + # Set CFLAGS and libraries. + CFLAGS = -I. -I$(BUILD) -I$(TOP) + LIBS = -lm + + # Define the required source files. + SRC_C = \ + main.c \ + mphalport.c \ + shared/readline/readline.c \ + shared/runtime/gchelper_generic.c \ + shared/runtime/pyexec.c \ + shared/runtime/stdout_helpers.c \ + + # Define the required object files. + OBJ = $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) + + # Define the top-level target, the main firmware. + all: $(BUILD)/firmware.elf + + # Define how to build the firmware. + $(BUILD)/firmware.elf: $(OBJ) + $(ECHO) "LINK $@" + $(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(Q)$(SIZE) $@ + + # Include remaining core make rules. + include $(TOP)/py/mkrules.mk + +Remember to use proper tabs to indent the Makefile. + +MicroPython Configurations +-------------------------- + +After integrating the minimal code above, the next step is to create the MicroPython +configuration files for the port. The compile-time configurations are specified in +``mpconfigport.h`` and additional hardware-abstraction functions, such as time keeping, +in ``mphalport.h``. + +The following is an example of an ``mpconfigport.h`` file: + +.. code-block:: c + + #include + + // Python internal features. + #define MICROPY_ENABLE_GC (1) + #define MICROPY_HELPER_REPL (1) + #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) + #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) + + // Enable u-modules to be imported with their standard name, like sys. + #define MICROPY_MODULE_WEAK_LINKS (1) + + // Fine control over Python builtins, classes, modules, etc. + #define MICROPY_PY_ASYNC_AWAIT (0) + #define MICROPY_PY_BUILTINS_SET (0) + #define MICROPY_PY_ATTRTUPLE (0) + #define MICROPY_PY_COLLECTIONS (0) + #define MICROPY_PY_MATH (0) + #define MICROPY_PY_IO (0) + #define MICROPY_PY_STRUCT (0) + + // Type definitions for the specific machine. + + typedef intptr_t mp_int_t; // must be pointer size + typedef uintptr_t mp_uint_t; // must be pointer size + typedef long mp_off_t; + + // We need to provide a declaration/definition of alloca(). + #include + + // Define the port's name and hardware. + #define MICROPY_HW_BOARD_NAME "example-board" + #define MICROPY_HW_MCU_NAME "unknown-cpu" + + #define MP_STATE_PORT MP_STATE_VM + + #define MICROPY_PORT_ROOT_POINTERS \ + const char *readline_hist[8]; + +This configuration file contains machine-specific configurations including aspects like if different +MicroPython features should be enabled e.g. ``#define MICROPY_ENABLE_GC (1)``. Making this Setting +``(0)`` disables the feature. + +Other configurations include type definitions, root pointers, board name, microcontroller name +etc. + +Similarly, an minimal example ``mphalport.h`` file looks like this: + +.. code-block:: c + + static inline void mp_hal_set_interrupt_char(char c) {} + +Support for standard input/output +--------------------------------- + +MicroPython requires at least a way to output characters, and to have a REPL it also +requires a way to input characters. Functions for this can be implemented in the file +``mphalport.c``, for example: + +.. code-block:: c + + #include + #include "py/mpconfig.h" + + // Receive single character, blocking until one is available. + int mp_hal_stdin_rx_chr(void) { + unsigned char c = 0; + int r = read(STDIN_FILENO, &c, 1); + (void)r; + return c; + } + + // Send the string of given length. + void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) { + int r = write(STDOUT_FILENO, str, len); + (void)r; + } + +These input and output functions have to be modified depending on the +specific board API. This example uses the standard input/output stream. + +Building and running +-------------------- + +At this stage the directory of the new port should contain:: + + ports/example_port/ + ├── main.c + ├── Makefile + ├── mpconfigport.h + ├── mphalport.c + └── mphalport.h + +The port can now be built by running ``make`` (or otherwise, depending on your system). + +If you are using the default compiler settings in the Makefile given above then this +will create an executable called ``build/firmware.elf`` which can be executed directly. +To get a functional REPL you may need to first configure the terminal to raw mode: + +.. code-block:: bash + + $ stty raw opost -echo + $ ./build/firmware.elf + +That should give a MicroPython REPL. You can then run commands like: + +.. code-block:: bash + + MicroPython v1.13 on 2021-01-01; example-board with unknown-cpu + >>> import sys + >>> sys.implementation + ('micropython', (1, 13, 0)) + >>> + +Use Ctrl-D to exit, and then run ``reset`` to reset the terminal. + +Adding a module to the port +--------------------------- + +To add a custom module like ``myport``, first add the module definition in a file +``modmyport.c``: + +.. code-block:: c + + #include "py/runtime.h" + + STATIC mp_obj_t myport_info(void) { + mp_printf(&mp_plat_print, "info about my port\n"); + return mp_const_none; + } + STATIC MP_DEFINE_CONST_FUN_OBJ_0(myport_info_obj, myport_info); + + STATIC const mp_rom_map_elem_t myport_module_globals_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_myport) }, + { MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&myport_info_obj) }, + }; + STATIC MP_DEFINE_CONST_DICT(myport_module_globals, myport_module_globals_table); + + const mp_obj_module_t myport_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&myport_module_globals, + }; + + MP_REGISTER_MODULE(MP_QSTR_myport, myport_module); + +You will also need to edit the Makefile to add ``modmyport.c`` to the ``SRC_C`` list, and +a new line adding the same file to ``SRC_QSTR`` (so qstrs are searched for in this new file), +like this: + +.. code-block:: Makefile + + SRC_C = \ + main.c \ + modmyport.c \ + mphalport.c \ + ... + + SRC_QSTR += modmyport.c + +If all went correctly then, after rebuilding, you should be able to import the new module: + +.. code-block:: bash + + >>> import myport + >>> myport.info() + info about my port + >>> diff --git a/components/language/micropython/docs/develop/publiccapi.rst b/components/language/micropython/docs/develop/publiccapi.rst new file mode 100644 index 00000000..132c7b13 --- /dev/null +++ b/components/language/micropython/docs/develop/publiccapi.rst @@ -0,0 +1,25 @@ +.. _publiccapi: + +The public C API +================ + +The public C-API comprises functions defined in all C header files in the ``py/`` +directory. Most of the important core runtime C APIs are exposed in ``runtime.h`` and +``obj.h``. + +The following is an example of public API functions from ``obj.h``: + +.. code-block:: c + + mp_obj_t mp_obj_new_list(size_t n, mp_obj_t *items); + mp_obj_t mp_obj_list_append(mp_obj_t self_in, mp_obj_t arg); + mp_obj_t mp_obj_list_remove(mp_obj_t self_in, mp_obj_t value); + void mp_obj_list_get(mp_obj_t self_in, size_t *len, mp_obj_t **items); + +At its core, any functions and macros in header files make up the public +API and can be used to access very low-level details of MicroPython. Static +inline functions in header files are fine too, such functions will be +inlined in the code when used. + +Header files in the ``ports`` directory are only exposed to the functionality +specific to a given port. diff --git a/components/language/micropython/docs/develop/qstr.rst b/components/language/micropython/docs/develop/qstr.rst new file mode 100644 index 00000000..5d1ac5bb --- /dev/null +++ b/components/language/micropython/docs/develop/qstr.rst @@ -0,0 +1,115 @@ +.. _qstr: + +MicroPython string interning +============================ + +MicroPython uses `string interning`_ to save both RAM and ROM. This avoids +having to store duplicate copies of the same string. Primarily, this applies to +identifiers in your code, as something like a function or variable name is very +likely to appear in multiple places in the code. In MicroPython an interned +string is called a QSTR (uniQue STRing). + +A QSTR value (with type ``qstr``) is a index into a linked list of QSTR pools. +QSTRs store their length and a hash of their contents for fast comparison during +the de-duplication process. All bytecode operations that work with strings use +a QSTR argument. + +Compile-time QSTR generation +---------------------------- + +In the MicroPython C code, any strings that should be interned in the final +firmware are written as ``MP_QSTR_Foo``. At compile time this will evaluate to +a ``qstr`` value that points to the index of ``"Foo"`` in the QSTR pool. + +A multi-step process in the ``Makefile`` makes this work. In summary this +process has three parts: + +1. Find all ``MP_QSTR_Foo`` tokens in the code. + +2. Generate a static QSTR pool containing all the string data (including lengths + and hashes). + +3. Replace all ``MP_QSTR_Foo`` (via the preprocessor) with their corresponding + index. + +``MP_QSTR_Foo`` tokens are searched for in two sources: + +1. All files referenced in ``$(SRC_QSTR)``. This is all C code (i.e. ``py``, + ``extmod``, ``ports/stm32``) but not including third-party code such as + ``lib``. + +2. Additional ``$(QSTR_GLOBAL_DEPENDENCIES)`` (which includes ``mpconfig*.h``). + +*Note:* ``frozen_mpy.c`` (generated by mpy-tool.py) has its own QSTR generation +and pool. + +Some additional strings that can't be expressed using the ``MP_QSTR_Foo`` syntax +(e.g. they contain non-alphanumeric characters) are explicitly provided in +``qstrdefs.h`` and ``qstrdefsport.h`` via the ``$(QSTR_DEFS)`` variable. + +Processing happens in the following stages: + +1. ``qstr.i.last`` is the concatenation of putting every single input file + through the C pre-processor. This means that any conditionally disabled code + will be removed, and macros expanded. This means we don't add strings to the + pool that won't be used in the final firmware. Because at this stage (thanks + to the ``NO_QSTR`` macro added by ``QSTR_GEN_CFLAGS``) there is no + definition for ``MP_QSTR_Foo`` it passes through this stage unaffected. This + file also includes comments from the preprocessor that include line number + information. Note that this step only uses files that have changed, which + means that ``qstr.i.last`` will only contain data from files that have + changed since the last compile. + +2. ``qstr.split`` is an empty file created after running ``makeqstrdefs.py split`` + on qstr.i.last. It's just used as a dependency to indicate that the step ran. + This script outputs one file per input C file, ``genhdr/qstr/...file.c.qstr``, + which contains only the matched QSTRs. Each QSTR is printed as ``Q(Foo)``. + This step is necessary to combine the existing files with the new data + generated from the incremental update in ``qstr.i.last``. + +3. ``qstrdefs.collected.h`` is the output of concatenating ``genhdr/qstr/*`` + using ``makeqstrdefs.py cat``. This is now the full set of ``MP_QSTR_Foo``'s + found in the code, now formatted as ``Q(Foo)``, one-per-line, with duplicates. + This file is only updated if the set of qstrs has changed. A hash of the QSTR + data is written to another file (``qstrdefs.collected.h.hash``) which allows + it to track changes across builds. + +4. Generate an enumeration, each entry of which maps a ``MP_QSTR_Foo`` to it's corresponding index. + It concatenates ``qstrdefs.collected.h`` with ``qstrdefs*.h``, then it transforms + each line from ``Q(Foo)`` to ``"Q(Foo)"`` so they pass through the preprocessor + unchanged. Then the preprocessor is used to deal with any conditional + compilation in ``qstrdefs*.h``. Then the transformation is undone back to + ``Q(Foo)``, and saved as ``qstrdefs.preprocessed.h``. + +5. ``qstrdefs.generated.h`` is the output of ``makeqstrdata.py``. For each + ``Q(Foo)`` in qstrdefs.preprocessed.h (plus some extra hard-coded ones), it outputs + ``QDEF(MP_QSTR_Foo, (const byte*)"hash" "Foo")``. + +Then in the main compile, two things happen with ``qstrdefs.generated.h``: + +1. In qstr.h, each QDEF becomes an entry in an enum, which makes ``MP_QSTR_Foo`` + available to code and equal to the index of that string in the QSTR table. + +2. In qstr.c, the actual QSTR data table is generated as elements of the + ``mp_qstr_const_pool->qstrs``. + +.. _`string interning`: https://en.wikipedia.org/wiki/String_interning + +Run-time QSTR generation +------------------------ + +Additional QSTR pools can be created at runtime so that strings can be added to +them. For example, the code:: + + foo[x] = 3 + +Will need to create a QSTR for the value of ``x`` so it can be used by the +"load attr" bytecode. + +Also, when compiling Python code, identifiers and literals need to have QSTRs +created. Note: only literals shorter than 10 characters become QSTRs. This is +because a regular string on the heap always takes up a minimum of 16 bytes (one +GC block), whereas QSTRs allow them to be packed more efficiently into the pool. + +QSTR pools (and the underlying "chunks" that store the string data) are allocated +on-demand on the heap with a minimum size. diff --git a/components/language/micropython/docs/develop/writingtests.rst b/components/language/micropython/docs/develop/writingtests.rst new file mode 100644 index 00000000..9bb5178f --- /dev/null +++ b/components/language/micropython/docs/develop/writingtests.rst @@ -0,0 +1,70 @@ +.. _writingtests: + +Writing tests +============= + +Tests in MicroPython are located at the path ``tests/``. The following is a listing of +key directories and the run-tests.py runner script: + +.. code-block:: bash + + . + ├── basics + ├── extmod + ├── float + ├── micropython + ├── run-tests.py + ... + +There are subfolders maintained to categorize the tests. Add a test by creating a new file in one of the +existing folders or in a new folder. It's also possible to make custom tests outside this tests folder, +which would be recommended for a custom port. + +For example, add the following code in a file ``print.py`` in the ``tests/unix/`` subdirectory: + +.. code-block:: python + + def print_one(): + print(1) + + print_one() + +If you run your tests, this test should appear in the test output: + +.. code-block:: bash + + $ cd ports/unix + $ make tests + skip unix/extra_coverage.py + pass unix/ffi_callback.py + pass unix/ffi_float.py + pass unix/ffi_float2.py + pass unix/print.py + pass unix/time.py + pass unix/time2.py + +Tests are run by comparing the output from the test target against the output from CPython. +So any test should use print statements to indicate test results. + +For tests that can't be compared to CPython (i.e. micropython-specific functionality), +you can provide a ``.py.exp`` file which will be used as the truth for comparison. + +The other way to run tests, which is useful when running on targets other than the Unix port, is: + +.. code-block:: bash + + $ cd tests + $ ./run-tests.py + +Then to run on a board: + +.. code-block:: bash + + $ ./run-tests.py --target minimal --device /dev/ttyACM0 + +And to run only a certain set of tests (eg a directory): + +.. code-block:: bash + + $ ./run-tests.py -d basics + $ ./run-tests.py float/builtin*.py diff --git a/components/language/micropython/docs/differences/index_template.txt b/components/language/micropython/docs/differences/index_template.txt new file mode 100644 index 00000000..dbbd7fc0 --- /dev/null +++ b/components/language/micropython/docs/differences/index_template.txt @@ -0,0 +1,24 @@ +.. _cpython_diffs: + +MicroPython differences from CPython +==================================== + +MicroPython implements Python 3.4 and some select features of Python 3.5 and +above. The sections below describe the current status of these features. + +.. toctree:: + + ../differences/python_35.rst + ../differences/python_36.rst + ../differences/python_37.rst + ../differences/python_38.rst + ../differences/python_39.rst + +For the features of Python that are implemented by MicroPython, there are +sometimes differences in their behaviour compared to standard Python. The +operations listed in the sections below produce conflicting results in +MicroPython when compared to standard Python. + +.. toctree:: + :maxdepth: 2 + diff --git a/components/language/micropython/docs/differences/python_35.rst b/components/language/micropython/docs/differences/python_35.rst new file mode 100644 index 00000000..94b10b58 --- /dev/null +++ b/components/language/micropython/docs/differences/python_35.rst @@ -0,0 +1,181 @@ +.. _python_35: + +Python 3.5 +========== + +Below is a list of finalised/accepted PEPs for Python 3.5 grouped into their impact to MicroPython. + + +----------------------------------------------------------------------------------------------------------+---------------+ + | **Extensions to the syntax:** | **Status** | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 448 `_ | additional unpacking generalizations | Partial | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 465 `_ | a new matrix multiplication operator | Completed | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 492 `_ | coroutines with async and await syntax | Completed | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | **Extensions and changes to runtime:** | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 461 `_ | % formatting for binary strings | Completed | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 475 `_ | retrying system calls that fail with EINTR | Completed | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 479 `_ | change StopIteration handling inside generators | Completed | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | **Standard library changes:** | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 471 `_ | os.scandir() | | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 485 `_ | math.isclose(), a function for testing | Completed | + | | approximate equality | | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | **Miscellaneous changes:** | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 441 `_ | improved Python zip application support | | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 486 `_ | make the Python Launcher aware of virtual | Not relevant | + | | environments | | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 484 `_ | type hints (advisory only) | In Progress | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 488 `_ | elimination of PYO files | Not relevant | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + | `PEP 489 `_ | redesigning extension module loading | | + +--------------------------------------------------------+-------------------------------------------------+---------------+ + + +Other Language Changes: + + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Added the *namereplace* error handlers. The *backslashreplace* error handlers now work with decoding and | | + | translating. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Property docstrings are now writable. This is especially useful for collections.namedtuple() docstrings | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Circular imports involving relative imports are now supported. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + + +New Modules: + +* `typing `_ + +* `zipzap `_ + + +Changes to built-in modules: + + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `collections `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *OrderedDict* class is now implemented in C, which makes it 4 to 100 times faster. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | *OrderedDict.items()* , *OrderedDict.keys()* , *OrderedDict.values()* views now support reversed() | | + | iteration. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The deque class now defines *index()*, *insert()*, and *copy()*, and supports the + and * operators. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Docstrings produced by namedtuple() can now be updated. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The UserString class now implements the *__getnewargs__()*, *__rmod__()*, *casefold()*, *format_map()*, | | + | *isprintable()*, and *maketrans()* methods to match the corresponding methods of str. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `heapq `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Element comparison in *merge()* can now be customized by passing a key function in a new optional key | | + | keyword argument, and a new optional *reverse* keyword argument can be used to reverse element comparison | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `io `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | A new *BufferedIOBase.readinto1()* method, that uses at most one call to the underlying raw stream's | | + | *RawIOBase.read()* or *RawIOBase.readinto()* methods | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `json `_ | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | JSON decoder now raises JSONDecodeError instead of ValueError to provide better context information about | | + | the error. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `math `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Two new constants have been added to the math module: *inf* and *nan*. | Completed | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | A new function *isclose()* provides a way to test for approximate equality. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | A new *gcd()* function has been added. The *fractions.gcd()* function is now deprecated. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `os `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The new *scandir()* function returning an iterator of DirEntry objects has been added. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *urandom()* function now uses the *getrandom()* syscall on Linux 3.17 or newer, and *getentropy()* on | | + | OpenBSD 5.6 and newer, removing the need to use /dev/urandom and avoiding failures due to potential file | | + | descriptor exhaustion. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | New *get_blocking()* and *set_blocking()* functions allow getting and setting a file descriptor's blocking| | + | mode (O_NONBLOCK.) | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | There is a new *os.path.commonpath()* function returning the longest common sub-path of each passed | | + | pathname | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `re `_ | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | References and conditional references to groups with fixed length are now allowed in lookbehind assertions| | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The number of capturing groups in regular expressions is no longer limited to 100. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *sub()* and *subn()* functions now replace unmatched groups with empty strings instead of raising an | | + | exception. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *re.error* exceptions have new attributes, msg, pattern, pos, lineno, and colno, that provide better | | + | context information about the error | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `socket `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Functions with timeouts now use a monotonic clock, instead of a system clock. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | A new *socket.sendfile()* method allows sending a file over a socket by using the high-performance | | + | *os.sendfile()* function on UNIX, resulting in uploads being from 2 to 3 times faster than when using | | + | plain *socket.send()* | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *socket.sendall()* method no longer resets the socket timeout every time bytes are received or sent. | | + | The socket timeout is now the maximum total duration to send all data. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The backlog argument of the *socket.listen()* method is now optional. By default it is set to SOMAXCONN or| Completed | + | to 128, whichever is less. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `ssl `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Memory BIO Support | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | Application-Layer Protocol Negotiation Support | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | There is a new *SSLSocket.version()* method to query the actual protocol version in use. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The SSLSocket class now implements a *SSLSocket.sendfile()* method. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *SSLSocket.send()* method now raises either the *ssl.SSLWantReadError* or *ssl.SSLWantWriteError* | | + | exception on a non-blocking socket if the operation would block. Previously, it would return 0. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *cert_time_to_seconds()* function now interprets the input time as UTC and not as local time, per RFC | | + | 5280. Additionally, the return value is always an int. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | New *SSLObject.shared_ciphers()* and *SSLSocket.shared_ciphers()* methods return the list of ciphers sent | | + | by the client during the handshake. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *SSLSocket.do_handshake()*, *SSLSocket.read()*, *SSLSocket.shutdown()*, and *SSLSocket.write()* | | + | methods of the SSLSocket class no longer reset the socket timeout every time bytes are received or sent. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *match_hostname()* function now supports matching of IP addresses. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `sys `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | A new *set_coroutine_wrapper()* function allows setting a global hook that will be called whenever a | | + | coroutine object is created by an async def function. A corresponding *get_coroutine_wrapper()* can be | | + | used to obtain a currently set wrapper. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | A new *is_finalizing()* function can be used to check if the Python interpreter is shutting down. | | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | `time `_ | + +-----------------------------------------------------------------------------------------------------------+---------------+ + | The *monotonic()* function is now always available | | + +-----------------------------------------------------------------------------------------------------------+---------------+ diff --git a/components/language/micropython/docs/differences/python_36.rst b/components/language/micropython/docs/differences/python_36.rst new file mode 100644 index 00000000..edf6bef0 --- /dev/null +++ b/components/language/micropython/docs/differences/python_36.rst @@ -0,0 +1,191 @@ +.. _python_36: + +Python 3.6 +========== + +Python 3.6 beta 1 was released on 12 Sep 2016, and a summary of the new features can be found here: + + +-----------------------------------------------------------------------------------------------------------+--------------+ + | **New Syntax Features:** | **Status** | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 498 `_ | Literal String Formatting | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 515 `_ | Underscores in Numeric Literals | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 525 `_ | Asynchronous Generators | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 526 `_ | Syntax for Variable Annotations (provisional) | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 530 `_ | Asynchronous Comprehensions | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | **New Built-in Features:** | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 468 `_ | Preserving the order of *kwargs* in a function | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 487 `_ | Simpler customization of class creation | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 520 `_ | Preserving Class Attribute Definition Order | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | **Standard Library Changes:** | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 495 `_ | Local Time Disambiguation | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 506 `_ | Adding A Secrets Module To The Standard Library | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 519 `_ | Adding a file system path protocol | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | **CPython internals:** | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 509 `_ | Add a private version to dict | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 523 `_ | Adding a frame evaluation API to CPython | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | **Linux/Window Changes** | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 524 `_ | Make os.urandom() blocking on Linux | | + | | (during system startup) | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 528 `_ | Change Windows console encoding to UTF-8 | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + | `PEP 529 `_ | Change Windows filesystem encoding to UTF-8 | | + +--------------------------------------------------------+--------------------------------------------------+--------------+ + +Other Language Changes: + + +-------------------------------------------------------------------------------------------------------------+---------------+ + | A *global* or *nonlocal* statement must now textually appear before the first use of the affected name in | | + | the same scope. Previously this was a SyntaxWarning. | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | It is now possible to set a special method to None to indicate that the corresponding operation is not | | + | available. For example, if a class sets *__iter__()* to *None* , the class is not iterable. | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Long sequences of repeated traceback lines are now abbreviated as *[Previous line repeated {count} more | | + | times]* | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Import now raises the new exception *ModuleNotFoundError* when it cannot find a module. Code that currently | | + | checks for ImportError (in try-except) will still work. | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Class methods relying on zero-argument *super()* will now work correctly when called from metaclass methods | | + | during class creation. | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + +Changes to built-in modules: + + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `array `_ | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Exhausted iterators of *array.array* will now stay exhausted even if the iterated array is extended. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `binascii `_ | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The b2a_base64() function now accepts an optional newline keyword argument to control whether the newline | Completed | + | character is appended to the return value | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `cmath `_ | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new cmath.tau (τ) constant has been added | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | New constants: *cmath.inf* and *cmath.nan* to match *math.inf* and *math.nan* , and also *cmath.infj* and | | + | *cmath.nanj* to match the format used by complex repr | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `collections `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new Collection abstract base class has been added to represent sized iterable container classes | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new *Reversible* abstract base class represents iterable classes that also provide the *__reversed__()* | | + | method. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new *AsyncGenerator* abstract base class represents asynchronous generators. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The *namedtuple()* function now accepts an optional keyword argument module, which, when specified, is used | | + | for the *__module__* attribute of the returned named tuple class. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The verbose and rename arguments for *namedtuple()* are now keyword-only. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Recursive *collections.deque* instances can now be pickled. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `hashlib `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | BLAKE2 hash functions were added to the module. *blake2b()* and *blake2s()* are always available and support | | + | the full feature set of BLAKE2. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The SHA-3 hash functions *sha3_224()*, *sha3_256()*, *sha3_384()*, *sha3_512()*, and *SHAKE* hash functions | | + | *shake_128()* and *shake_256()* were added. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The password-based key derivation function *scrypt()* is now available with OpenSSL 1.1.0 and newer. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `json `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | *json.load()* and *json.loads()* now support binary input. Encoded JSON should be represented using either | | + | UTF-8, UTF-16, or UTF-32. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `math `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new math.tau (τ) constant has been added | Completed | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `os `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | A new *close()* method allows explicitly closing a *scandir()* iterator. The *scandir()* iterator now | | + | supports the context manager protocol. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | On Linux, *os.urandom()* now blocks until the system urandom entropy pool is initialized to increase the | | + | security. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The Linux *getrandom()* syscall (get random bytes) is now exposed as the new *os.getrandom()* function. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `re `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Added support of modifier spans in regular expressions. Examples: *'(?i:p)ython'* matches 'python' and | | + | 'Python', but not 'PYTHON'; *'(?i)g(?-i:v)r'* matches *'GvR'* and *'gvr'*, but not *'GVR'* . | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Match object groups can be accessed by *__getitem__*, which is equivalent to *group()*. So *mo['name']* is | | + | now equivalent to *mo.group('name')*. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Match objects now support index-like objects as group indices. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `socket `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The *ioctl()* function now supports the *SIO_LOOPBACK_FAST_PATH* control code. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The *getsockopt()* constants *SO_DOMAIN* , *SO_PROTOCOL*, *SO_PEERSEC* , and *SO_PASSSEC* are now supported. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The *setsockopt()* now supports the *setsockopt(level, optname, None, optlen: int)* form. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The socket module now supports the address family *AF_ALG* to interface with Linux Kernel crypto API. | | + | *ALG_*, *SOL_ALG* and *sendmsg_afalg()* were added. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | New Linux constants *TCP_USER_TIMEOUT* and *TCP_CONGESTION* were added. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `ssl `_ | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | ssl supports OpenSSL 1.1.0. The minimum recommend version is 1.0.2. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | 3DES has been removed from the default cipher suites and ChaCha20 Poly1305 cipher suites have been added. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | *SSLContext* has better default configuration for options and ciphers. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | SSL session can be copied from one client-side connection to another with the new *SSLSession* class. TLS | | + | session resumption can speed up the initial handshake, reduce latency and improve performance. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new *get_ciphers()* method can be used to get a list of enabled ciphers in order of cipher priority. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | All constants and flags have been converted to *IntEnum* and *IntFlags*. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Server and client-side specific TLS protocols for *SSLContext* were added. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | Added *SSLContext.post_handshake_auth* to enable and *ssl.SSLSocket.verify_client_post_handshake()* to | | + | initiate TLS 1.3 post-handshake authentication. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `struct `_ | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | now supports IEEE 754 half-precision floats via the 'e' format specifier. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `sys `_ | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The new *getfilesystemencodeerrors()* function returns the name of the error mode used to convert between | | + | Unicode filenames and bytes filenames. | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | `zlib `_ | | + +--------------------------------------------------------------------------------------------------------------+----------------+ + | The *compress()* and *decompress()* functions now accept keyword arguments | | + +--------------------------------------------------------------------------------------------------------------+----------------+ diff --git a/components/language/micropython/docs/differences/python_37.rst b/components/language/micropython/docs/differences/python_37.rst new file mode 100644 index 00000000..c46678e9 --- /dev/null +++ b/components/language/micropython/docs/differences/python_37.rst @@ -0,0 +1,95 @@ +.. _python_37: + +Python 3.7 +========== + +New Features: + + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | **Features:** | **Status** | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 538 `_ | Coercing the legacy C locale to a UTF-8 based | | + | | locale | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 539 `_ | A New C-API for Thread-Local Storage in CPython | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 540 `_ | UTF-8 mode | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 552 `_ | Deterministic pyc | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 553 `_ | Built-in breakpoint() | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 557 `_ | Data Classes | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 560 `_ | Core support for typing module and generic types | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 562 `_ | Module __getattr__ and __dir__ | Partially done | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 563 `_ | Postponed Evaluation of Annotations | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 564 `_ | Time functions with nanosecond resolution | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 565 `_ | Show DeprecationWarning in __main__ | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + | `PEP 567 `_ | Context Variables | | + +--------------------------------------------------------+--------------------------------------------------+----------------+ + +Other Language Changes: + + +----------------------------------------------------------------------------------------------------------+----------------+ + | async and await are now reserved keywords | Completed | + +----------------------------------------------------------------------------------------------------------+----------------+ + | dict objects must preserve insertion-order | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | More than 255 arguments can now be passed to a function; a function can now have more than 255 parameters| | + +----------------------------------------------------------------------------------------------------------+----------------+ + | bytes.fromhex() and bytearray.fromhex() now ignore all ASCII whitespace, not only spaces | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | str, bytes, and bytearray gained support for the new isascii() method, which can be used to test if a | | + | string or bytes contain only the ASCII characters | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | ImportError now displays module name and module __file__ path whenfrom ... import ... fails | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | Circular imports involving absolute imports with binding a submodule to a name are now supported | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | object.__format__(x, '') is now equivalent to str(x) rather than format(str(self), '') | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | In order to better support dynamic creation of stack traces, types.TracebackType can now be instantiated | | + | from Python code, and the tb_next attribute on tracebacks is now writable | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | When using the -m switch, sys.path[0] is now eagerly expanded to the full starting directory path, rather| | + | than being left as the empty directory (which allows imports from the current working directory at the | | + | time when an import occurs) | | + +----------------------------------------------------------------------------------------------------------+----------------+ + | The new -X importtime option or the PYTHONPROFILEIMPORTTIME environment variable can be used to show the | | + | timing of each module import | | + +----------------------------------------------------------------------------------------------------------+----------------+ + +Changes to built-in modules: + + +------------------------------------------------------------------------------------------------------------+----------------+ + | `asyncio `_ | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | asyncio (many, may need a separate ticket) | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | `gc `_ | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | New features include *gc.freeze()*, *gc.unfreeze()*, *gc-get_freeze_count* | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | `math `_ | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | math.remainder() added to implement IEEE 754-style remainder | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | `re `_ | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | A number of tidy up features including better support for splitting on empty strings and copy support for | | + | compiled expressions and match objects | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | `sys `_ | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | sys.breakpointhook() added. sys.get(/set)_coroutine_origin_tracking_depth() added | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | `time `_ | | + +------------------------------------------------------------------------------------------------------------+----------------+ + | Mostly updates to support nanosecond resolution in PEP564, see above | | + +------------------------------------------------------------------------------------------------------------+----------------+ diff --git a/components/language/micropython/docs/differences/python_38.rst b/components/language/micropython/docs/differences/python_38.rst new file mode 100644 index 00000000..47840a8b --- /dev/null +++ b/components/language/micropython/docs/differences/python_38.rst @@ -0,0 +1,118 @@ +.. _python_38: + +Python 3.8 +========== + +Python 3.8.0 (final) was released on the 14 October 2019. The Features for 3.8 +are defined in `PEP 569 `_ and +a detailed description of the changes can be found in What's New in `Python +3.8. `_ + + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | **Features:** | Status | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | `PEP 570 `_ | Positional-only arguments | | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | `PEP 572 `_ | Assignment Expressions | | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | `PEP 574 `_ | Pickle protocol 5 with out-of-band data | | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | `PEP 578 `_ | Runtime audit hooks | | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | `PEP 587 `_ | Python Initialization Configuration | | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | `PEP 590 `_ | Vectorcall: a fast calling protocol for CPython | | + +--------------------------------------------------------+---------------------------------------------------+---------------+ + | **Miscellaneous** | + +------------------------------------------------------------------------------------------------------------+---------------+ + | f-strings support = for self-documenting expressions and debugging | Completed | + +------------------------------------------------------------------------------------------------------------+---------------+ + +Other Language Changes: + + +------------------------------------------------------------------------------------------------------------+-------------+ + | A *continue* statement was illegal in the *finally* clause due to a problem with the implementation. In | Completed | + | Python 3.8 this restriction was lifted | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | The *bool*, *int* , and *fractions.Fraction* types now have an *as_integer_ratio()* method like that found | | + | in *float* and *decimal.Decimal* | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Constructors of *int*, *float* and *complex* will now use the *__index__()* special method, if available | | + | and the corresponding method *__int__()*, *__float__()* or *__complex__()* is not available | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added support of *\N{name}* escapes in regular expressions | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Dict and dictviews are now iterable in reversed insertion order using *reversed()* | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | The syntax allowed for keyword names in function calls was further restricted. In particular, | | + | f((keyword)=arg) is no longer allowed | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Generalized iterable unpacking in yield and return statements no longer requires enclosing parentheses | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | When a comma is missed in code such as [(10, 20) (30, 40)], the compiler displays a SyntaxWarning with a | | + | helpful suggestion | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Arithmetic operations between subclasses of *datetime.date* or *datetime.datetime* and *datetime.timedelta*| | + | objects now return an instance of the subclass, rather than the base class | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | When the Python interpreter is interrupted by *Ctrl-C (SIGINT)* and the resulting *KeyboardInterrupt* | | + | exception is not caught, the Python process now exits via a SIGINT signal or with the correct exit code | | + | such that the calling process can detect that it died due to a *Ctrl-C* | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Some advanced styles of programming require updating the *types.CodeType* object for an existing function | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | For integers, the three-argument form of the pow() function now permits the exponent to be negative in the | | + | case where the base is relatively prime to the modulus | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Dict comprehensions have been synced-up with dict literals so that the key is computed first and the value | | + | second | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | The *object.__reduce__()* method can now return a tuple from two to six elements long | | + +------------------------------------------------------------------------------------------------------------+-------------+ + +Changes to built-in modules: + + +------------------------------------------------------------------------------------------------------------+-------------+ + | `asyncio` | + +------------------------------------------------------------------------------------------------------------+-------------+ + | *asyncio.run()* has graduated from the provisional to stable API | Completed | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Running *python -m asyncio* launches a natively async REPL | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | The exception *asyncio.CancelledError* now inherits from *BaseException* rather than *Exception* and no | Completed | + | longer inherits from *concurrent.futures.CancelledError* | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added *asyncio.Task.get_coro()* for getting the wrapped coroutine within an *asyncio.Task* | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Asyncio tasks can now be named, either by passing the name keyword argument to *asyncio.create_task()* or | | + | the *create_task()* event loop method, or by calling the *set_name()* method on the task object | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added support for Happy Eyeballs to *asyncio.loop.create_connection()*. To specify the behavior, two new | | + | parameters have been added: *happy_eyeballs_delay* and interleave. | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | `gc` | + +------------------------------------------------------------------------------------------------------------+-------------+ + | *get_objects()* can now receive an optional generation parameter indicating a generation to get objects | | + | from. (Note, though, that while *gc* is a built-in, *get_objects()* is not implemented for MicroPython) | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | `math` | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added new function *math.dist()* for computing Euclidean distance between two points | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Expanded the *math.hypot()* function to handle multiple dimensions | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added new function, *math.prod()*, as analogous function to *sum()* that returns the product of a "start" | | + | value (default: 1) times an iterable of numbers | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added two new combinatoric functions *math.perm()* and *math.comb()* | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Added a new function *math.isqrt()* for computing accurate integer square roots without conversion to | | + | floating point | | + +------------------------------------------------------------------------------------------------------------+-------------+ + | The function *math.factorial()* no longer accepts arguments that are not int-like | Completed | + +------------------------------------------------------------------------------------------------------------+-------------+ + | `sys` | + +------------------------------------------------------------------------------------------------------------+-------------+ + | Add new *sys.unraisablehook()* function which can be overridden to control how "unraisable exceptions" | | + | are handled | | + +------------------------------------------------------------------------------------------------------------+-------------+ diff --git a/components/language/micropython/docs/differences/python_39.rst b/components/language/micropython/docs/differences/python_39.rst new file mode 100644 index 00000000..6852dd63 --- /dev/null +++ b/components/language/micropython/docs/differences/python_39.rst @@ -0,0 +1,121 @@ +.. _python_39: + +Python 3.9 +========== + +Python 3.9.0 (final) was released on the 5th October 2020. The Features for 3.9 are +defined in `PEP 596 `_ +and a detailed description of the changes can be found in +`What's New in Python 3.9 `_ + + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | **Features:** | | **Status** | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 573 `_ | fast access to module state from methods of C | | + | | extension types | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 584 `_ | union operators added to dict | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 585 `_ | type hinting generics in standard collections | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 593 `_ | flexible function and variable annotations | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 602 `_ | CPython adopts an annual release cycle. Instead of | | + | | annual, aiming for two month release cycle | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 614 `_ | relaxed grammar restrictions on decorators | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 615 `_ | the IANA Time Zone Database is now present in the | | + | | standard library in the zoneinfo module | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 616 `_ | string methods to remove prefixes and suffixes | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + | `PEP 617 `_ | CPython now uses a new parser based on PEG | | + +--------------------------------------------------------+----------------------------------------------------+--------------+ + +Other Language Changes: + + +-------------------------------------------------------------------------------------------------------------+---------------+ + | *__import__()* now raises *ImportError* instead of *ValueError* | Completed | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Python now gets the absolute path of the script filename specified on the command line (ex: *python3* | | + | *script.py*): the *__file__* attribute of the *__main__* module became an absolute path, rather than a | | + | relative path | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | By default, for best performance, the errors argument is only checked at the first encoding/decoding error | | + | and the encoding argument is sometimes ignored for empty strings | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | *"".replace("", s, n)* now returns *s* instead of an empty string for all non-zero n. It is now consistent | | + | with *"".replace("", s)* | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Any valid expression can now be used as a decorator. Previously, the grammar was much more restrictive | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Parallel running of *aclose()* / *asend()* / *athrow()* is now prohibited, and *ag_running* now reflects | | + | the actual running status of the async generator | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Unexpected errors in calling the *__iter__* method are no longer masked by TypeError in the in operator and | | + | functions contains(), indexOf() and countOf() of the operator module | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + | Unparenthesized lambda expressions can no longer be the expression part in an if clause in comprehensions | | + | and generator expressions | | + +-------------------------------------------------------------------------------------------------------------+---------------+ + +Changes to built-in modules: + + +---------------------------------------------------------------------------------------------------------------+---------------+ + | `asyncio` | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Due to significant security concerns, the reuse_address parameter of *asyncio.loop.create_datagram_endpoint()*| | + | is no longer supported | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added a new coroutine *shutdown_default_executor()* that schedules a shutdown for the default executor that | | + | waits on the *ThreadPoolExecutor* to finish closing. Also, *asyncio.run()* has been updated to use the new | | + | coroutine. | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added *asyncio.PidfdChildWatcher*, a Linux-specific child watcher implementation that polls process file | | + | descriptors | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | added a new *coroutine asyncio.to_thread()* | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | When cancelling the task due to a timeout, *asyncio.wait_for()* will now wait until the cancellation is | | + | complete also in the case when timeout is <= 0, like it does with positive timeouts | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | *asyncio* now raises *TyperError* when calling incompatible methods with an *ssl.SSLSocket* socket | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | `gc` | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Garbage collection does not block on resurrected objects | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added a new function *gc.is_finalized()* to check if an object has been finalized by the garbage collector | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | `math` | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Expanded the *math.gcd()* function to handle multiple arguments. Formerly, it only supported two arguments | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added *math.lcm()*: return the least common multiple of specified arguments | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added *math.nextafter()*: return the next floating-point value after x towards y | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added *math.ulp()*: return the value of the least significant bit of a float | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | `os` | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Exposed the Linux-specific *os.pidfd_open()* and *os.P_PIDFD* | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | The *os.unsetenv()* function is now also available on Windows | Completed | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | The *os.putenv()* and *os.unsetenv()* functions are now always available | Completed | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added *os.waitstatus_to_exitcode()* function: convert a wait status to an exit code | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | `random` | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added a new *random.Random.randbytes* method: generate random bytes | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | `sys` | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Added a new *sys.platlibdir* attribute: name of the platform-specific library directory | | + +---------------------------------------------------------------------------------------------------------------+---------------+ + | Previously, *sys.stderr* was block-buffered when non-interactive. Now stderr defaults to always being | | + | line-buffered | | + +---------------------------------------------------------------------------------------------------------------+---------------+ diff --git a/components/language/micropython/docs/esp32/general.rst b/components/language/micropython/docs/esp32/general.rst new file mode 100644 index 00000000..8137c042 --- /dev/null +++ b/components/language/micropython/docs/esp32/general.rst @@ -0,0 +1,64 @@ +.. _esp32_general: + +General information about the ESP32 port +======================================== + +The ESP32 is a popular WiFi and Bluetooth enabled System-on-Chip (SoC) by +Espressif Systems. + +Multitude of boards +------------------- + +There is a multitude of modules and boards from different sources which carry +the ESP32 chip. MicroPython tries to provide a generic port which would run on +as many boards/modules as possible, but there may be limitations. Espressif +development boards are taken as reference for the port (for example, testing is +performed on them). For any board you are using please make sure you have a +datasheet, schematics and other reference materials so you can look up any +board-specific functions. + +To make a generic ESP32 port and support as many boards as possible the +following design and implementation decision were made: + +* GPIO pin numbering is based on ESP32 chip numbering. Please have the manual/pin + diagram of your board at hand to find correspondence between your board pins and + actual ESP32 pins. +* All pins are supported by MicroPython but not all are usable on any given board. + For example pins that are connected to external SPI flash should not be used, + and a board may only expose a certain selection of pins. + + +Technical specifications and SoC datasheets +------------------------------------------- + +The datasheets and other reference material for ESP32 chip are available +from the vendor site: https://www.espressif.com/en/support/download/documents?keys=esp32 . +They are the primary reference for the chip technical specifications, capabilities, +operating modes, internal functioning, etc. + +For your convenience, some of technical specifications are provided below: + +* Architecture: Xtensa Dual-Core 32-bit LX6 +* CPU frequency: up to 240MHz +* Total RAM available: 528KB (part of it reserved for system) +* BootROM: 448KB +* Internal FlashROM: none +* External FlashROM: code and data, via SPI Flash; usual size 4MB +* GPIO: 34 (GPIOs are multiplexed with other functions, including + external FlashROM, UART, etc.) +* UART: 3 RX/TX UART (no hardware handshaking), one TX-only UART +* SPI: 4 SPI interfaces (one used for FlashROM) +* I2C: 2 I2C (bitbang implementation available on any pins) +* I2S: 2 +* ADC: 12-bit SAR ADC up to 18 channels +* DAC: 2 8-bit DACs +* RMT: 8 channels allowing accurate pulse transmit/receive +* Programming: using BootROM bootloader from UART - due to external FlashROM + and always-available BootROM bootloader, the ESP32 is not brickable + +For more information see the ESP32 datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf + +MicroPython is implemented on top of the ESP-IDF, Espressif's development +framework for the ESP32. This is a FreeRTOS based system. See the +`ESP-IDF Programming Guide `_ +for details. diff --git a/components/language/micropython/docs/esp32/img/esp32.jpg b/components/language/micropython/docs/esp32/img/esp32.jpg new file mode 100644 index 00000000..a96ddcbe Binary files /dev/null and b/components/language/micropython/docs/esp32/img/esp32.jpg differ diff --git a/components/language/micropython/docs/esp32/quickref.rst b/components/language/micropython/docs/esp32/quickref.rst new file mode 100644 index 00000000..894508f4 --- /dev/null +++ b/components/language/micropython/docs/esp32/quickref.rst @@ -0,0 +1,756 @@ +.. _esp32_quickref: + +Quick reference for the ESP32 +============================= + +.. image:: img/esp32.jpg + :alt: ESP32 board + :width: 640px + +The Espressif ESP32 Development Board (image attribution: Adafruit). + +Below is a quick reference for ESP32-based boards. If it is your first time +working with this board it may be useful to get an overview of the microcontroller: + +.. toctree:: + :maxdepth: 1 + + general.rst + tutorial/index.rst + +Installing MicroPython +---------------------- + +See the corresponding section of tutorial: :ref:`esp32_intro`. It also includes +a troubleshooting subsection. + +General board control +--------------------- + +The MicroPython REPL is on UART0 (GPIO1=TX, GPIO3=RX) at baudrate 115200. +Tab-completion is useful to find out what methods an object has. +Paste mode (ctrl-E) is useful to paste a large slab of Python code into +the REPL. + +The :mod:`machine` module:: + + import machine + + machine.freq() # get the current frequency of the CPU + machine.freq(240000000) # set the CPU frequency to 240 MHz + +The :mod:`esp` module:: + + import esp + + esp.osdebug(None) # turn off vendor O/S debugging messages + esp.osdebug(0) # redirect vendor O/S debugging messages to UART(0) + + # low level methods to interact with flash storage + esp.flash_size() + esp.flash_user_start() + esp.flash_erase(sector_no) + esp.flash_write(byte_offset, buffer) + esp.flash_read(byte_offset, buffer) + +The :mod:`esp32` module:: + + import esp32 + + esp32.hall_sensor() # read the internal hall sensor + esp32.raw_temperature() # read the internal temperature of the MCU, in Fahrenheit + esp32.ULP() # access to the Ultra-Low-Power Co-processor + +Note that the temperature sensor in the ESP32 will typically read higher than +ambient due to the IC getting warm while it runs. This effect can be minimised +by reading the temperature sensor immediately after waking up from sleep. + +Networking +---------- + +The :mod:`network` module:: + + import network + + wlan = network.WLAN(network.STA_IF) # create station interface + wlan.active(True) # activate the interface + wlan.scan() # scan for access points + wlan.isconnected() # check if the station is connected to an AP + wlan.connect('essid', 'password') # connect to an AP + wlan.config('mac') # get the interface's MAC address + wlan.ifconfig() # get the interface's IP/netmask/gw/DNS addresses + + ap = network.WLAN(network.AP_IF) # create access-point interface + ap.config(essid='ESP-AP') # set the ESSID of the access point + ap.config(max_clients=10) # set how many clients can connect to the network + ap.active(True) # activate the interface + +A useful function for connecting to your local WiFi network is:: + + def do_connect(): + import network + wlan = network.WLAN(network.STA_IF) + wlan.active(True) + if not wlan.isconnected(): + print('connecting to network...') + wlan.connect('essid', 'password') + while not wlan.isconnected(): + pass + print('network config:', wlan.ifconfig()) + +Once the network is established the :mod:`socket ` module can be used +to create and use TCP/UDP sockets as usual, and the ``urequests`` module for +convenient HTTP requests. + +After a call to ``wlan.connect()``, the device will by default retry to connect +**forever**, even when the authentication failed or no AP is in range. +``wlan.status()`` will return ``network.STAT_CONNECTING`` in this state until a +connection succeeds or the interface gets disabled. This can be changed by +calling ``wlan.config(reconnects=n)``, where n are the number of desired reconnect +attempts (0 means it won't retry, -1 will restore the default behaviour of trying +to reconnect forever). + +Delay and timing +---------------- + +Use the :mod:`time