added support for STM32F7DISC board

This commit is contained in:
prolomb 2020-05-12 11:43:17 +02:00 committed by Amir Gonnen
parent 983cc35210
commit 836a087bd9
7 changed files with 51 additions and 2 deletions

View File

@ -169,6 +169,22 @@ char *strcpy(char *dest, const char *src) {
return dest; return dest;
} }
// added for littlevgl
char *strncpy(char * dest, const char * src, size_t n){
if (n != 0) {
char *d = dest;
const char *s = src;
do {
if ((*d++ = *s++) == '\0') {
while (--n != 0)
*d++ = '\0';
break;
}
} while (--n != 0);
}
return (dest);
}
// needed because gcc optimises strcpy + strcat to this // needed because gcc optimises strcpy + strcat to this
char *stpcpy(char *dest, const char *src) { char *stpcpy(char *dest, const char *src) {
while (*src) { while (*src) {

View File

@ -459,6 +459,19 @@ DRIVERS_SRC_C += drivers/cyw43/cywbt.c
endif endif
endif endif
ifeq ($(MICROPY_PY_LVGL),1)
CFLAGS += -DMICROPY_PY_LVGL
SRC_LIB += $(shell find $(LVGL_BINDING_DIR)/driver/stm32/$(BOARD)/*.c)
ifeq ($(MCU_SERIES),$(filter $(MCU_SERIES),f7))
SRC_HAL += $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES)xx_,\
hal_ltdc.c \
hal_ltdc_ex.c \
hal_dma2d.c \
)
LIBS += /lib/arm-none-eabi/newlib/thumb/v7e-m/fpv4-sp/hard/libc.a
endif
endif
OBJ = OBJ =
OBJ += $(PY_O) OBJ += $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_LIB:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_LIB:.c=.o))

View File

@ -9,3 +9,4 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1 MICROPY_PY_LWIP = 1
MICROPY_PY_USSL = 1 MICROPY_PY_USSL = 1
MICROPY_SSL_MBEDTLS = 1 MICROPY_SSL_MBEDTLS = 1
MICROPY_PY_LVGL = 1

View File

@ -1,4 +1,4 @@
freeze('$(MPY_DIR)/drivers/dht', 'dht.py') freeze('$(MPY_DIR)/drivers/dht', 'dht.py')
freeze('$(MPY_DIR)/drivers/display', ('lcd160cr.py', 'lcd160cr_test.py')) freeze('$(MPY_DIR)/drivers/display', ('lcd160cr.py', 'lcd160cr_test.py'))
freeze('$(MPY_DIR)/drivers/onewire', 'onewire.py') freeze('$(MPY_DIR)/drivers/onewire', 'onewire.py')
freeze('$(MPY_DIR)/ports/stm32/modules', 'lvstm32.py') freeze("$(MPY_DIR)/lib/lv_bindings/driver/stm32", "lvstm32.py")

View File

@ -53,6 +53,9 @@
#include "stm32f7xx_hal_uart.h" #include "stm32f7xx_hal_uart.h"
#include "stm32f7xx_hal_usart.h" #include "stm32f7xx_hal_usart.h"
#include "stm32f7xx_hal_wwdg.h" #include "stm32f7xx_hal_wwdg.h"
#include "stm32f7xx_hal_ltdc.h"
#include "stm32f7xx_hal_ltdc_ex.h"
#include "stm32f7xx_hal_dma2d.h"
// Enable various HAL modules // Enable various HAL modules
#define HAL_ADC_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED
@ -81,6 +84,8 @@
#define HAL_UART_MODULE_ENABLED #define HAL_UART_MODULE_ENABLED
#define HAL_USART_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED
#define HAL_WWDG_MODULE_ENABLED #define HAL_WWDG_MODULE_ENABLED
#define HAL_LTDC_MODULE_ENABLED
#define HAL_DMA2D_MODULE_ENABLED
// Oscillator values in Hz // Oscillator values in Hz
#define HSI_VALUE (16000000) #define HSI_VALUE (16000000)

View File

@ -173,7 +173,7 @@
#ifndef MICROPY_PY_NETWORK #ifndef MICROPY_PY_NETWORK
#define MICROPY_PY_NETWORK (1) #define MICROPY_PY_NETWORK (1)
#endif #endif
#define MICROPY_PY_LVGL (1) //#define MICROPY_PY_LVGL (1)
// fatfs configuration used in ffconf.h // fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1) #define MICROPY_FATFS_ENABLE_LFN (1)

View File

@ -887,3 +887,17 @@ void I2C4_ER_IRQHandler(void) {
#endif // defined(MICROPY_HW_I2C4_SCL) #endif // defined(MICROPY_HW_I2C4_SCL)
#endif // MICROPY_PY_PYB_LEGACY #endif // MICROPY_PY_PYB_LEGACY
#if defined(HAL_DMA2D_MODULE_ENABLED)
extern DMA2D_HandleTypeDef *hdma2d;
void DMA2D_IRQHandler(void) {
HAL_DMA2D_IRQHandler(hdma2d);
}
#endif
#if defined(HAL_LTDC_MODULE_ENABLED)
extern LTDC_HandleTypeDef *hltdc;
void LTDC_IRQHandler(void) {
HAL_LTDC_IRQHandler(hltdc);
}
#endif