2019-01-25 12:25 PM
The code is identical to the Disable version. The enable swapping is currently this:
void HAL_SYSCFG_EnableMemorySwappingBank(void)
{
*(__IO uint32_t *)FB_MODE_BB = 0x00000000UL;
}
and instead of = 0, it should be the equivalent of 0x100.
Also, the lower 3-bits should be maintained since they are MEM_MODE bits. As it turns out, %000 is Main Flash memory, which is probably good for most, but it's still a bad implementation.
Solved! Go to Solution.
2019-02-04 01:08 AM
Hi @pgspro1 ,
This is a Bit Banding access, not a full register access.
/* Alias word address of FB_MODE bit */
#define MEMRMP_OFFSET SYSCFG_OFFSET
#define FB_MODE_BitNumber 8U
#define FB_MODE_BB (PERIPH_BB_BASE + (MEMRMP_OFFSET * 32U) + (FB_MODE_BitNumber * 4U))
So, there is a bug and the fix should be :
void HAL_SYSCFG_EnableMemorySwappingBank(void)
{
*(__IO uint32_t *)FB_MODE_BB = 0x00000001UL;
}
Avantage of the bit banding, No effects on the other bits of the SYSCFG_MEMRMP register with this single instruction.
Thanks for highlighting this issue.
Kind Regards,
Imen.
2019-02-01 05:51 AM
Hello,
We will check this issue internally and we will come back to you.
Kind Regards,
Imen
2019-02-04 01:08 AM
Hi @pgspro1 ,
This is a Bit Banding access, not a full register access.
/* Alias word address of FB_MODE bit */
#define MEMRMP_OFFSET SYSCFG_OFFSET
#define FB_MODE_BitNumber 8U
#define FB_MODE_BB (PERIPH_BB_BASE + (MEMRMP_OFFSET * 32U) + (FB_MODE_BitNumber * 4U))
So, there is a bug and the fix should be :
void HAL_SYSCFG_EnableMemorySwappingBank(void)
{
*(__IO uint32_t *)FB_MODE_BB = 0x00000001UL;
}
Avantage of the bit banding, No effects on the other bits of the SYSCFG_MEMRMP register with this single instruction.
Thanks for highlighting this issue.
Kind Regards,
Imen.
2019-04-15 09:22 AM
Hello,
This issue is fixed with the new release of STM32CubeL4 V1.14.0 available on the ST web site.
Regards,
Imen.