Hi,
I try to implement LCD module into micropython firmware on STM32F746G-disco.
But in SDRAM store statement, CPU hardware exception causes as bus fault.
Why?
void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
{
/* Write data value to all SDRAM memory */
if(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)
{ /* RGB565 format */
*(__IO uint16_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos))) = (uint16_t)RGB_Code;
}
else
{ /* ARGB8888 format */
*(__IO uint32_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*BSP_LCD_GetXSize() + Xpos))) = RGB_Code;
}
}
F7disco BSP for LCD causes bus error.
Re: F7disco BSP for LCD causes bus error.
Was the SDRAM initialized? i.e. did you setup the clocks, turn it on, etc?
If you setup the board to have a serial REPL (instead of a USB one) then you'll get some more information printed on the serial REPL about the fault, including the actual address which caused the fault.
If you setup the board to have a serial REPL (instead of a USB one) then you'll get some more information printed on the serial REPL about the fault, including the actual address which caused the fault.
Re: F7disco BSP for LCD causes bus error.
Hi,
I setup machine.freq(192000000).
And then I call BSP_LCD_Init() function.
The function includes BSP_SDRAM_Init() function.
F7disco's LCD BSP could be found here:
https://os.mbed.com/teams/ST/code/BSP_D ... very_lcd.c
I aleady use TrueStudio to debug at symblic, but st-link debug is very slow.
I will try simple serial (non USB)REPL.
Thank you.
I setup machine.freq(192000000).
And then I call BSP_LCD_Init() function.
The function includes BSP_SDRAM_Init() function.
F7disco's LCD BSP could be found here:
https://os.mbed.com/teams/ST/code/BSP_D ... very_lcd.c
I aleady use TrueStudio to debug at symblic, but st-link debug is very slow.
I will try simple serial (non USB)REPL.
Thank you.
Re: F7disco BSP for LCD causes bus error.
Hi,
I scucessed merging BSP driver of LCD(STM32F746G-discovery) to MicroPython.
The source codes repository be found here: https://github.com/forester3/micropytho ... f7disc-lcd
But BSP driver has some probrem, so you try to use carefully this module.
https://os.mbed.com/teams/ST/code/BSP_D ... cd_8c.html
The LCD module calls the BSP global function described in the above URL.
How to use LCD module.
import lcdF7D
lcdF7D.init()
lcdF7D.set_font(18)
lcdF7D.display_string_at_line(3,"Hello, STM32F746G-Discovery")
lcdF7D.set_font(16)
lcdF7D.display_string_at_line(5,"Good collaboration with MicroPython !")
lcdF7D.deinit()
I scucessed merging BSP driver of LCD(STM32F746G-discovery) to MicroPython.
The source codes repository be found here: https://github.com/forester3/micropytho ... f7disc-lcd
But BSP driver has some probrem, so you try to use carefully this module.
https://os.mbed.com/teams/ST/code/BSP_D ... cd_8c.html
The LCD module calls the BSP global function described in the above URL.
How to use LCD module.
import lcdF7D
lcdF7D.init()
lcdF7D.set_font(18)
lcdF7D.display_string_at_line(3,"Hello, STM32F746G-Discovery")
lcdF7D.set_font(16)
lcdF7D.display_string_at_line(5,"Good collaboration with MicroPython !")
lcdF7D.deinit()
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: F7disco BSP for LCD causes bus error.
It is great!
lcdconsole for F7disco
Hi,
I updated lcd module for STM32F746G-Disco. It is named "lcdF7D".
Now it works lcd console to use uos.dupterm.
>>> import lcdconsole
>>> con = lcdconsole.LcdConsole()
>>> uos.dupterm(con)
This lcdconsole module will be found here: https://github.com/forester3/micropytho ... console.py
I updated lcd module for STM32F746G-Disco. It is named "lcdF7D".
Now it works lcd console to use uos.dupterm.
>>> import lcdconsole
>>> con = lcdconsole.LcdConsole()
>>> uos.dupterm(con)
This lcdconsole module will be found here: https://github.com/forester3/micropytho ... console.py
-
- Posts: 7
- Joined: Sat Feb 09, 2019 1:51 pm
Re: F7disco BSP for LCD causes bus error.
I'm having an issue finding "lcdF7D"... When you say "import lcdF7D"... searching high and low, I can't find it. Can you tell me where it is hiding?
Thanks
Jim
Thanks
Jim
Re: F7disco BSP for LCD causes bus error.
Sorry about the delayed response but I found this thread while trying to answer the same question in anohter thread.jrprogrammer wrote: ↑Sat May 18, 2019 3:58 pmI'm having an issue finding "lcdF7D"... When you say "import lcdF7D"... searching high and low, I can't find it. Can you tell me where it is hiding?
Thanks
It looks like forester3 implemented a driver for the LCD in their fork of micropython, at
In particular the code is here:
https://github.com/forester3/micropytho ... odlcdF7D.c
I don't know what other functionality it depends on from that fork, but it might be possible to copy it over into upstream micropython and add it to your build. See relevant changes to https://github.com/forester3/micropytho ... nfigport.h and lots of stuff in https://github.com/forester3/micropytho ... TM32F7DISC