2022-05-12 08:34 AM
Hello,
I'm using a STM32WL55JC in dual core configuration to communicate with LoRa protocol.
I'm also working on an OLED display interface using I2C communication on the same MCU.
I have a working application using LoRa communication without OLED interface.
The OLED interface work well also without the LoRa application.
But when I join the two project, the radio init function drive me into errorhandler...
After investigating I find some weird happening...
First, the radio init bug occured only when I'm calling ssd1306_WriteString. But it doesn't matter what is in this function, in fact if I comment everythings in it, its still bugging... So just the fact that I'm calling it make my programm bug... May it come from parameters of the fonction ?
Secondly, If I call ssd1306_WriteString before the radio init, it print what I want on the screen and when radio init happen it's bugging... But also, if I'm calling ssd1306_WriteString after radio init, it's bugging on radio init... How it can be possible ?? ssd1306_WriteString was never called and it make bug radio ???
I really can't find any links between all of this....
There is more detail on ssd1306_WriteString font parameter :
typedef struct {
const uint8_t FontWidth; /*!< Font width in pixels */
uint8_t FontHeight; /*!< Font height in pixels */
const uint16_t *data; /*!< Pointer to data font data array */
} FontDef;
2022-05-17 07:24 AM
I find out that this must be a memory problem.
The data member of FontDef is an bitmap array of the font for all ASCI table and It was declared as static const (so in the flash I guess).
I try to delete static et const and its start to work. But Now when I add more datas (bitmap images) It's planting when a restart occured, When the programm check refTable validity
I assume that the reserved memory for CM4 is too small for this kind of data and that its righting over CM0+ Datas...
How can I change memory mapping ?
2022-05-17 09:19 AM
The Linker Script or Scatter File will describe how the link positions information.
For the SH1106/SSD130x I typically keep my fonts in FLASH.
I'm using them with other LoRa implementations, without issue.
Make sure you're not blocking.
I would buffer pending data so as not to hang up other code waiting for the screen to paint, and upload via I2C, in an idle task, or slack time in the main loop;
2022-05-18 12:09 AM
@Community member Thanks for your answer !
Just few more question so that I understand well.
Thanks