-
I got this error when running 'lbuild build' what is the problem? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
The Module You will have to port this to STM32F0 or use raw register access. |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks, I got it. |
Beta Was this translation helpful? Give feedback.
-
I compared the STM32F0 and STM32G0 Reference Manual sections on the Flash Peripheral, and they seem to work very similiarly with 1-2kB page size, only some registers bit fields have different names ( So if you have time and motivation you could adapt the STM32G0 driver for the STM32F0 one. |
Beta Was this translation helpful? Give feedback.
-
oh? that sounds good, let me try. thanks. |
Beta Was this translation helpful? Give feedback.
-
it can't directly use STM32G0 driver for STM32F0, modm_ramcode uint32_t
Flash::erase(uint8_t index)
{
FLASH->SR = FLASH_SR_ERR;
FLASH->CR = FLASH_CR_STRT | FLASH_CR_PER |
((index << FLASH_CR_PNB_Pos) & FLASH_CR_PNB_Msk);
while(isBusy()) ;
FLASH->CR = 0;
return FLASH->SR & FLASH_SR_ERR;
} STM32F0 FLASH_CR register doesn't have FLASH_CR_PNB_Pos bit. |
Beta Was this translation helpful? Give feedback.
-
Oh, that's sad! I guess the drivers are a little more different than I thought. I think I read something about accessing a memory location inside flash, and then the hardware automatically calculates the sector/page from that. But it's all inconsistent across STM32. I was a little overwhelmed by all the little differences like this, hence only implementing it for two families to at least get something started. |
Beta Was this translation helpful? Give feedback.
-
You've done most of the work, I think there is slight difference, I check the STM32 user manual to see if I can get the STM32F0 flash work. |
Beta Was this translation helpful? Give feedback.
it can't directly use STM32G0 driver for STM32F0,
STM32F0 FLASH_CR register doesn't have FLASH_CR_PNB_Pos bit.