cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 H757I-Eval Board - LCD not turning on/LED not blinking

Konn'
Associate II

EDIT: (normal text: fixed/sorted out(see the new program code in the end) | in bold - still needing help)

Hi, guys! So, I just got this board yesterday and I am having some trouble.

First, the LCD doesn't go on! I plug the power supply, LD9 goes on, plugging the micro A to the computer using the STLINK USB Port, I get red at the LD12 and that's all;

I was following a tutorial on Udemy on how to blink a LED, but although the LED goes on, it doesn't blink;

I even downloaded CubeProg and did those resets to see if 'd help, but it didn't;

Another thing is: How can I completely 'turn off' CM4, so that it doesn't appear on CubeIDE, doesn't generate errors and so on?

I tried to disable it using OB, but still. Every time I create an STM32 Project on the IDE it is there on the project tree, and I'd have to setting everything up for it as well.

The code I am trying is:

#include "stm32h757xx.h"
 
#define GPIOKEN					(1U<<10) //page 492
#define PIN6 					(1U << 5)
#define LED_PIN					(PIN6)
 
int main(void){
	//enable clock access to GPIOK
	RCC->AHB4ENR 		|= 		GPIOKEN;
	//Set GPIOK as OP
	GPIOK->MODER 		&=~		(3U << 12); //reset bit 12 and 13
	GPIOK->MODER 		|=		(1U << 12); //set bit 12
	while(1){
		//toggle PIN6
		GPIOK->ODR ^= LED_PIN;
		for(int i = 0; i<100000; i++){}
 
	}
}
 

PS: I went to the add paths and symbols and added STM32H757xx and CORE_CM7 to the symbols and (using the CubeH7 pack) I added the include folders from Drivers\Include and from Drivers\Device\ST\STM32H7xx\Include;

The code above compiles; I get the blue LED on, but it doesn't blink;

Can you guys help me?

Did I spoil my board by software/hard/core resetting it through the CubeProg?

Why does the LCD doesn't go on? Do I have to change jumpers? Does it need program code first?

How to work only with the CM7?

The course I am following follow the bare-metal approach, hence this code;

I followed some tutorials that used the HAL Library but it just added a bunch of more stuff to the project tree, populated the main way too much; besides, I'd like to learn how to work with the registers directly; aaah, and even using the HAL tutorials on the LCD didn't go on;

PS: Yeah, may I should have got a single-core board, but it was a gift, so....

Thanks!

0693W00000KZnOlQAL.jpg0693W00000KZnPFQA1.jpg

#include "stm32h757xx.h"
 
#define GPIOKEN				(1U<<10) //page 492
#define PIN3 					(1U << 3)
#define LED3_PIN				(PIN3)
#define PIN4 					(1U << 4)
#define LED4_PIN				(PIN4)
#define PIN5 					(1U << 5)
#define LED5_PIN				(PIN5)
#define PIN6 					(1U << 6)
#define LED6_PIN				(PIN6)
 
 
int main(void){
	//enable clock access to GPIOK
	RCC->AHB4ENR 		|= 		GPIOKEN;
	//Set GPIOKs as OP
	GPIOK->MODER 		&=~		(3U << 6); //reset 7.6
	GPIOK->MODER 		|=		(1U << 6); //set 6
	GPIOK->MODER 		&=~		(3U << 8); //reset 9.8
	GPIOK->MODER 		|=		(1U << 8); //set 8
	GPIOK->MODER 		&=~		(3U << 10); //reset bit 11.10
	GPIOK->MODER 		|=		(1U << 10); //set 10
	GPIOK->MODER 		&=~		(3U << 12); //reset 12.13
	GPIOK->MODER 		|=		(1U << 12); //set 12
	while(1){
		//toggle LED PINs
		GPIOK->ODR ^= LED3_PIN;
		for(int i = 0; i<1350000; i++){}
		GPIOK->ODR ^= LED4_PIN;
		for(int i = 0; i<1350000; i++){}
		GPIOK->ODR ^= LED5_PIN;
		for(int i = 0; i<1350000; i++){}
		GPIOK->ODR ^= LED6_PIN;
		for(int i = 0; i<1350000; i++){}
 
	}
}
//PS: even got they blinking in sequence now ^^

1 ACCEPTED SOLUTION

Accepted Solutions

The LCD has a complex set of requirements and timings.

On the STM32 you have to set up a frame buffer, the LTDC with its clocks, the DSI to consume the pixel data and funnel it to the display.The display also likely needs a host of its configuration registers set correctly.

It's not that the board is ill-suited to register level programming, but rather that assuming that jumping into the middle of the ocean, clothed, is the best way to learn how to swim, or even a desirable one if you know how to swim.

The CubeH7 should have a handful of examples of driving the display under the Application and Example forks for the board. Use those as a simple starting point, understand how the HAL works, and the overall level of complexity, and then look at how you might approach a register level implementation, if that's even worth the time/effort involved, or if there are more productive and helpful skills you can learn with the board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

11 REPLIES 11
MM..1
Chief II

If optimize levels is setup in your project your for code is removed out and led toggle on high invisible speed...

Your idea for register coding with LCD is absurd.

In project create wizard you can select example project for your board...

The bit pattern is for PK5 other PK6​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yeah, during editing the code to paste here/try on the board I forgot to change the LEDs shift;

Believe me or not, I now got them blinking;

My code now looks like:

#include "stm32h757xx.h"
 
#define GPIOKEN				(1U<<10) //page 492
#define PIN5 					(1U << 5)
#define LED5_PIN				(PIN5)
#define PIN6 					(1U << 6)
#define LED6_PIN				(PIN6)
 
int main(void){
	//enable clock access to GPIOK
	RCC->AHB4ENR 		|= 		GPIOKEN;
	//Set GPIOKs as OP
	GPIOK->MODER 		&=~		(3U << 10); //reset bit 10 and 11
	GPIOK->MODER 		|=		(1U << 10); //set bit 10
	GPIOK->MODER 		&=~		(3U << 12); //reset bit 12 and 13
	GPIOK->MODER 	        |=		(1U << 12); //set bit 12
	while(1){
		//toggle LED PINs
		GPIOK->ODR ^= LED5_PIN;
		for(int i = 0; i<1350000; i++){}
		GPIOK->ODR ^= LED6_PIN;
		for(int i = 0; i<1350000; i++){}
 
	}
}

Thanks for the correction.

CliveOne, could you please help me with the LCD issue? Is the LCD broken or what sort of extra settings does it need?

I did nothing to/with it; the only coding running on the board is the LEDs one and I didn't change any of the pins/jumpers;

Thanks again! I am new to the Community, and looking at the posts here, I very often see you giving very good answers to people's problem; that's quite nice of you;

  • Yeah, the 'ignore the for-loop' point could indeed be a thing, so I tried the code below(see my asnwer to Tesla) and now I can see them blinking; I mean, the for loop seems to be working now;
  • Could you please elaborate on the 'absurd' part? Should I buy another board then, if I wanted to learn 'register coding' or should I keep this one and learn how to work with HAL Libraries instead?
  • They don't really have examples for this specific eval board; they have for the H7457 , though I think some of the H747I code would indeed work with this one;
  • Do you have any idea why the LCD doesn't go on? Is there another specific set of power supply/jumpers, etc... needed in order to use it? I mean, I don't think I am going to program the display yet, since I still have much beginner things to learn, but I wanted to know what that LCD even looks like; without it turning on, I don't even know whether it's functional or not; I didn't want it to have production issues haha;

Thanks!

MM..1
Chief II

Absurd part is for example LCD with MIPI DSI® interface on your board need around 100 registers config for start working plus next regs for sdram ... You can do this , but your code will be ... but work maybe.

Good point is configure system with HAL and in custom code when required use registers...

The LCD has a complex set of requirements and timings.

On the STM32 you have to set up a frame buffer, the LTDC with its clocks, the DSI to consume the pixel data and funnel it to the display.The display also likely needs a host of its configuration registers set correctly.

It's not that the board is ill-suited to register level programming, but rather that assuming that jumping into the middle of the ocean, clothed, is the best way to learn how to swim, or even a desirable one if you know how to swim.

The CubeH7 should have a handful of examples of driving the display under the Application and Example forks for the board. Use those as a simple starting point, understand how the HAL works, and the overall level of complexity, and then look at how you might approach a register level implementation, if that's even worth the time/effort involved, or if there are more productive and helpful skills you can learn with the board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

STM32Cube_FW_H7_V1.9.1\Projects\STM32H747I-EVAL\Applications\STemWin\STemWin_HelloWorld

STM32Cube_FW_H7_V1.9.1\Projects\STM32H747I-EVAL\Examples\LCD_DSI\LCD_DSI_CmdMode_DoubleBuffer

STM32Cube_FW_H7_V1.9.1\Projects\STM32H747I-EVAL\Examples\LCD_DSI\LCD_DSI_VideoMode_SingleBuffer

STM32Cube_FW_H7_V1.9.1\Projects\STM32H747I-EVAL\Examples\DMA2D\DMA2D_RegToMemWithLCD

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

The trick is perhaps to know when time doing register level coding or optimization is an effective use of time, or not.

Times when it will be most impactful is where the algorithm spends most of it's time, or where the HAL comparatively uses far too many resources.

However when you write code like this, IT IS NOT EFFICIENT

  1. //Set GPIOKs as OP
  2. GPIOK->MODER &=~ (3U << 6); //reset 7.6
  3. GPIOK->MODER |= (1U << 6); //set 6
  4. GPIOK->MODER &=~ (3U << 8); //reset 9.8
  5. GPIOK->MODER |= (1U << 8); //set 8
  6. GPIOK->MODER &=~ (3U << 10); //reset bit 11.10
  7. GPIOK->MODER |= (1U << 10); //set 10
  8. GPIOK->MODER &=~ (3U << 12); //reset 12.13
  9. GPIOK->MODER |= (1U << 12); //set 12

There's eight load/store operations here, the registers are volatile, the complier can't optimize this and I've got several dozen instructions for a task that should take 3

The balance is to make the compiler do all the work at compile time, so the execution time of the code and the code size are optimal.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you so much for your reply;

Yeah, since I am not a professional yet, I should get to know what the HAL does first, before trying to optimise anything; and maybe get a less complex board to learn learn how to do the register programming, for I find that amazing ahah; although I am a student and work, when not at the Uni, I don't have a PhD final commercial product to deliver YET, so I may have a bit more freedom/time to experiment, therefore, everything I learn on Registers can only be of help for my later work and job;

I will also try to run the examples and see if I get the display to turn on; I guess I can't get it on when I power the board because I, when full erasing/resetting it, may have erased the manufacturer configuration/boot code that turns it on; I don't know it that makes sense, but anyways...

Again, thank you very much for your inputs.

Greetings from Germany.