Does MPY supports QSPI for STM32G4 series? #12824
Answered
by
andrewleech
nspsck
asked this question in
STM32 / Pyboard
-
Hi, I am trying to port for the new WeActStudio STM32G474CEU6 board and I've used configuartions like H7 boards as bellow. #if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
// QSPI flash for storage
#define MICROPY_HW_SPIFLASH_SIZE_BITS (64 * 1024 * 1024)
#define MICROPY_HW_QSPI_PRESCALER (2) // 100MHz
#define MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2 (26)
#define MICROPY_HW_QSPIFLASH_CS (pin_B11)
#define MICROPY_HW_QSPIFLASH_SCK (pin_B10)
#define MICROPY_HW_QSPIFLASH_IO0 (pin_B1)
#define MICROPY_HW_QSPIFLASH_IO1 (pin_B0)
#define MICROPY_HW_QSPIFLASH_IO2 (pin_A7)
#define MICROPY_HW_QSPIFLASH_IO3 (pin_A6)
// SPI flash #1, block device config
extern const struct _mp_spiflash_config_t spiflash_config;
extern struct _spi_bdev_t spi_bdev;
#define MICROPY_HW_BDEV_SPIFLASH (&spi_bdev)
#define MICROPY_HW_BDEV_SPIFLASH_CONFIG (&spiflash_config)
#define MICROPY_HW_BDEV_SPIFLASH_SIZE_BYTES (MICROPY_HW_SPIFLASH_SIZE_BITS / 8)
#define MICROPY_HW_BDEV_SPIFLASH_EXTENDED (&spi_bdev)
#endif However, I got warnings telling me that qspi.c: In function 'qspi_mpu_disable_all':
qspi.c:70:26: error: implicit declaration of function 'mpu_config_start' [-Werror=implicit-function-declaration]
70 | uint32_t irq_state = mpu_config_start();
| ^~~~~~~~~~~~~~~~
CC machine_bitstream.c
CC machine_i2c.c
CC machine_spi.c
CC machine_uart.c
qspi.c:71:5: error: implicit declaration of function 'mpu_config_region' [-Werror=implicit-function-declaration]
71 | mpu_config_region(MPU_REGION_QSPI1, QSPI_MAP_ADDR, MPU_CONFIG_DISABLE(0x00, MPU_REGION_SIZE_256MB));
| ^~~~~~~~~~~~~~~~~
CC modmachine.c
CC modpyb.c
qspi.c:71:23: error: 'MPU_REGION_QSPI1' undeclared (first use in this function); did you mean 'MPU_REGION_DISABLE'?
71 | mpu_config_region(MPU_REGION_QSPI1, QSPI_MAP_ADDR, MPU_CONFIG_DISABLE(0x00, MPU_REGION_SIZE_256MB));
| ^~~~~~~~~~~~~~~~
| MPU_REGION_DISABLE
qspi.c:71:23: note: each undeclared identifier is reported only once for each function it appears in
CC modstm.c
qspi.c:71:56: error: implicit declaration of function 'MPU_CONFIG_DISABLE'; did you mean 'MPU_REGION_DISABLE'? [-Werror=implicit-function-declaration]
71 | mpu_config_region(MPU_REGION_QSPI1, QSPI_MAP_ADDR, MPU_CONFIG_DISABLE(0x00, MPU_REGION_SIZE_256MB));
| ^~~~~~~~~~~~~~~~~~
| MPU_REGION_DISABLE
CC network_lan.c
qspi.c:72:5: error: implicit declaration of function 'mpu_config_end' [-Werror=implicit-function-declaration]
72 | mpu_config_end(irq_state);
| ^~~~~~~~~~~~~~ As well as some errors that are probably related to qspi.c: In function 'qspi_init':
qspi.c:119:136: error: implicit declaration of function 'STATIC_AF_QUADSPI_BK1_NCS'; did you mean 'STATIC_AF_QUADSPI1_BK1_NCS'? [-Werror=implicit-function-declaration]
119 | mp_hal_pin_config_alt_static_speed(MICROPY_HW_QSPIFLASH_CS, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, MP_HAL_PIN_SPEED_VERY_HIGH, STATIC_AF_QUADSPI_BK1_NCS);
|
^~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:45:44: note: in definition of macro 'mp_hal_pin_config_alt_static_speed'
45 | mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)); /* Overflow Error => alt func not found */ \
| ^~~~~~~
CC spibdev.c
CC storage.c
qspi.c:120:137: error: implicit declaration of function 'STATIC_AF_QUADSPI_CLK'; did you mean 'STATIC_AF_QUADSPI1_CLK'? [-Werror=implicit-function-declaration]
120 | mp_hal_pin_config_alt_static_speed(MICROPY_HW_QSPIFLASH_SCK, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, MP_HAL_PIN_SPEED_VERY_HIGH, STATIC_AF_QUADSPI_CLK);
|
^~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:45:44: note: in definition of macro 'mp_hal_pin_config_alt_static_speed'
45 | mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)); /* Overflow Error => alt func not found */ \
| ^~~~~~~
CC sdcard.c
qspi.c:121:137: error: implicit declaration of function 'STATIC_AF_QUADSPI_BK1_IO0'; did you mean 'STATIC_AF_QUADSPI1_BK1_IO0'? [-Werror=implicit-function-declaration]
121 | mp_hal_pin_config_alt_static_speed(MICROPY_HW_QSPIFLASH_IO0, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, MP_HAL_PIN_SPEED_VERY_HIGH, STATIC_AF_QUADSPI_BK1_IO0);
|
^~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:45:44: note: in definition of macro 'mp_hal_pin_config_alt_static_speed'
45 | mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)); /* Overflow Error => alt func not found */ \
| ^~~~~~~
CC sdram.c
CC fatfs_port.c
qspi.c:122:137: error: implicit declaration of function 'STATIC_AF_QUADSPI_BK1_IO1'; did you mean 'STATIC_AF_QUADSPI1_BK1_IO1'? [-Werror=implicit-function-declaration]
122 | mp_hal_pin_config_alt_static_speed(MICROPY_HW_QSPIFLASH_IO1, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, MP_HAL_PIN_SPEED_VERY_HIGH, STATIC_AF_QUADSPI_BK1_IO1);
|
^~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:45:44: note: in definition of macro 'mp_hal_pin_config_alt_static_speed'
45 | mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)); /* Overflow Error => alt func not found */ \
| ^~~~~~~
CC lcd.c
qspi.c:123:137: error: implicit declaration of function 'STATIC_AF_QUADSPI_BK1_IO2'; did you mean 'STATIC_AF_QUADSPI1_BK1_IO2'? [-Werror=implicit-function-declaration]
123 | mp_hal_pin_config_alt_static_speed(MICROPY_HW_QSPIFLASH_IO2, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, MP_HAL_PIN_SPEED_VERY_HIGH, STATIC_AF_QUADSPI_BK1_IO2);
|
^~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:45:44: note: in definition of macro 'mp_hal_pin_config_alt_static_speed'
45 | mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)); /* Overflow Error => alt func not found */ \
| ^~~~~~~
CC accel.c
CC servo.c
qspi.c:124:137: error: implicit declaration of function 'STATIC_AF_QUADSPI_BK1_IO3'; did you mean 'STATIC_AF_QUADSPI1_BK1_IO3'? [-Werror=implicit-function-declaration]
124 | mp_hal_pin_config_alt_static_speed(MICROPY_HW_QSPIFLASH_IO3, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, MP_HAL_PIN_SPEED_VERY_HIGH, STATIC_AF_QUADSPI_BK1_IO3);
|
^~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:45:44: note: in definition of macro 'mp_hal_pin_config_alt_static_speed'
45 | mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)); /* Overflow Error => alt func not found */ \
| ^~~~~~~ This leads me into believe that the qspi on the G4 series is not supported by MPY yet. Especially the |
Beta Was this translation helpful? Give feedback.
Answered by
andrewleech
Oct 28, 2023
Replies: 1 comment 1 reply
-
I recently had to enable this for WB55, take a look at #12512 You might also be interested in #12722 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nspsck
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently had to enable this for WB55, take a look at #12512
You might also be interested in #12722