Hello,
In order to use EFL+MFS on a G491, I had to fix the registry, I post here a G4 registry with bank number fixes for all lines, and I also add missing entries for G471 line.
I also had to fix minor forbidden arithmetic on void pointer, which is not allowed by the standard, and is catched by gcc 14.
Code: Select all
iff --git a/os/hal/ports/STM32/STM32G4xx/hal_efl_lld.c b/os/hal/ports/STM32/STM32G4xx/hal_efl_lld.c
index 82ff9e8a0..4644224d6 100644
--- a/os/hal/ports/STM32/STM32G4xx/hal_efl_lld.c
+++ b/os/hal/ports/STM32/STM32G4xx/hal_efl_lld.c
@@ -116,6 +116,7 @@ static inline bool stm32_flash_dual_bank(EFlashDriver *eflp) {
#if STM32_FLASH_NUMBER_OF_BANKS > 1
return ((eflp->flash->OPTR & (FLASH_OPTR_DBANK)) != 0U);
#endif
+ (void) eflp;
return false;
}
@@ -241,8 +242,10 @@ flash_error_t efl_lld_read(void *instance, flash_offset_t offset,
stm32_flash_clear_status(devp);
/* Actual read implementation.*/
- memcpy((void *)rp, (const void *)efl_lld_get_descriptor(instance)->address
- + offset, n);
+ memcpy((void *)rp,
+ (const void *) ((uint32_t) efl_lld_get_descriptor(instance)->address
+ + offset),
+ n);
/* Checking for errors after reading.*/
if ((devp->flash->SR & FLASH_SR_RDERR) != 0U) {
Finally, I had to write a linker script for the G491, which has not the same memory layout than the G474.
Alexandre