but I need this option because it doesn’t take up memory what could be the problem?
What’s most interesting is that if I reduce the size of the array with a font less than 150 bytes, then the text output on the screen disappears again, provided that I display the characters remaining in the array and using the first option without CONST
There is another strange thing: if I take a complete array with a font without the CONST flag and do not access it in the program, and instead of the resulting text, display an image from the array, but with the CONST flag, then it will now be displayed on the screen if I add an array with in the CONST flag font and try to display the same image on the screen, it is no longer displayed
😕
1
Last edit: ivan23654623 2024-06-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With const, sdcc places the data in flash. Depending on the clock you use, flash might need wait states. AFAIK an STM8 running at a clock higher than 16 MHz needs one wait state in flash accesses, which needs to be configures before setting the clock that high (though I don't know if that is what you encountered).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
stm8s003f3 - UFQFPN20-pin
platformio+stm8spl+sdcc 4.4.0 +stvp
My code displays text on the OLED screen
I use the font as an array which I declare in the file "Font_JSE_ZXSpectrum_8px.c"
if I write like this, the text is displayed on the screen,
but if I write like this, it is not displayed
but I need this option because it doesn’t take up memory what could be the problem?
Last edit: ivan23654623 2024-06-18
guys, I found an error, I don’t know how it is related to the byte array
but at the beginning of the code I initialize the clock generator like this
and if everything is left like this, then this glitch will appear, but if I write like this
then everything works
Last edit: ivan23654623 2024-06-19
With const, sdcc places the data in flash. Depending on the clock you use, flash might need wait states. AFAIK an STM8 running at a clock higher than 16 MHz needs one wait state in flash accesses, which needs to be configures before setting the clock that high (though I don't know if that is what you encountered).
yes that's exactly what happened