cancel
Showing results for 
Search instead for 
Did you mean: 

Using STM32CubeMX to generate LCD/SDRAM code for STM32F746-DISCO board

Peter M_2
Associate II
Posted on June 04, 2018 at 07:10

I'm trying to generate some working code for a STM32F746-DISCO board using STM32CubeMX Rev 4.25.1

What I was expecting to happen is that I select all the peripherals, configure them how I'd like them to work, hit 'generate code' and it would make me a project that had everything initialised properly, ready to go. I could then write my application to use the peripherals as required.

So I go 'new project', select the STM32F746-DISCO board, say 'yes' to 'Initialise all peripherals with their default mode', disable camera, sound, ethernet and USB (I don't need them and it chokes at startup if the Ethernet isn't plugged in), generate code for EWARM and open the project in IAR. I then turn off compiler optimisation and change the debugger to J-Link (I reflashed the board with the Segger firmware because the ST/Link one wouldn't work properly).

I then program the board and let it run - the screen starts off white then goes black.

If I go to memory adfdress 0xc0000000 then IAR doesn't think there is anything there (it should be the SDRAM). Given that the frame buffer for the LCD is at this address that could explain that part of the problem.

Am I expecting too much from STM32CubeMX? Is it meant to generate a working app with working peripherals that I can then modify? Or am I expected to pull together code from the various example projects (eg SDRAM init code from the SDRAM project, LCD init code from the LCD project, etc) to make something that works.

#stm32cubemx #stm32f746-disco
5 REPLIES 5
Khouloud GARSI
Lead II
Posted on June 04, 2018 at 10:09

Hello Peter,

The STM32CubeMX is a graphical tool that allows the configuration of STM32 microcontrollers and the generation of the corresponding

initialization C code

. The result is a project directory including generated main.c file and C header files for

configuration

and

initialization

, plus a copy of the necessary HAL and middleware libraries as well as specific files for the selected IDE.

Then, the user can modify the generated source files by adding user-defined C code in user dedicated sections in order to make a working project.

Khouloud.

Posted on June 04, 2018 at 13:21

Hi

garsi.khouloud

I know that's what STM32CubeMx is meant to do. My understanding is that if I create a project for the STM32F746-DISCO board, using the peripherals set to their default mode, that everything should work.The SDRAM should be mapped to 0xC000 0000 and should be set up to operate properly without me writing a single line of code. I then write my application to use the SDRAM and other peripherals.

But as far as I can tell the SDRAM doesn't get initialised properly. I'm not sure if that's a 'bug' in STM32CubeMX or me expecting too much of it.

Peter

James Sullivan
Associate II
Posted on July 12, 2018 at 23:31

Hello,

I am also seeing this.

Did you ever find a solution ?

Jim

Posted on July 13, 2018 at 09:33

In attach test project

________________

Attachments :

746_new_free_1layer_with_sdio.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxQS&d=%2Fa%2F0X0000000axs%2F1YWgZ1OwBMZf2DHne9xmRB_T37rF7bXmOLjIvia0JHE&asPdf=false
Cyril FENARD
ST Employee

Hi,

Did you try to check STemWin in GRAPHICS from the CubeMX pinout view?

Then, the code generated from this produces the "Hello World" example.

You can also have a look in UM1718 for STM32CubeMx in the dedicated section, i.e. Tutorial 7 – Using STemWin Graphical framework.

Regards.

Cyril