Hello,
i have ran in a problem while getting started with the STM32F446ZE and the STemWin Library.
The used OS is embOS from your company.
I tried to follow you instructions to display "hello world" on the display.
I use the display driver ST7735S which should be supported by the FlexColor driver.
My problem is that instead of "hello world" the display stays white.
I configured GUIConf.h like that
In GUI_x I added the following in GUI_X_init() :
In UC_ST7735_init() the SPI-Port gets intiated. This part should work because it ist already used in the same sensor type. The only difference is, that I removed the graphcis library we used before. The addition lines activate the display and it's backlight.
In LCDConf_FlexColor_Template.c I set the resolution like this:
The follwing three methods I filled like that:
It should be metioned that UC_ST7735_writeSPI4Wire was also used before and should work. It sends one byte after each other instead of 16 bit at once.
I tried to send the high byte and the low byte in different orders.
Display All
I didn't change LCD_X_Config()
Display All
The code I run is:
Display All
There is no Compile-Error and the Watch Dog does not cause a problem.
The problem is that the display stays white.
I noticed that the command number which the flexchain driver sends over spi does not match the excpeted numbers from the St7735 datasheet.
I debugged the SPI method. The follwing commands and data got sent.
- a command with 0x00 as the high byte
- a command with 0x03 as the low byte. As far I know there is no command number 3 for theSTt7735
- data with 0x00 as the high byte
- data with 0x00 as the low byte
- a command with 0x00 as the high byte
- a command with 0x50 ('P') as the low byte.
- data with 0x00 as the high byte
- data with 0x00 as the low byte
- a command with 0x00 as the high byte
- a command with 0x51 ('Q') as the low byte.
- data with 0x00 as the high byte
- data with 0x63 as the low byte
- a command with 0x00 as the high byte
- a command with 0x52 as the low byte.
- data with 0x00 as the high byte
- data with 0x00 as the low byte
...
- after a while with more alternating commands and data there is just data with 0x00
Did I forget to config something?
Mit freundlichen Grüßen / Best regards
Lukas Hauser
i have ran in a problem while getting started with the STM32F446ZE and the STemWin Library.
The used OS is embOS from your company.
I tried to follow you instructions to display "hello world" on the display.
I use the display driver ST7735S which should be supported by the FlexColor driver.
My problem is that instead of "hello world" the display stays white.
I configured GUIConf.h like that
In GUI_x I added the following in GUI_X_init() :
In UC_ST7735_init() the SPI-Port gets intiated. This part should work because it ist already used in the same sensor type. The only difference is, that I removed the graphcis library we used before. The addition lines activate the display and it's backlight.
In LCDConf_FlexColor_Template.c I set the resolution like this:
The follwing three methods I filled like that:
It should be metioned that UC_ST7735_writeSPI4Wire was also used before and should work. It sends one byte after each other instead of 16 bit at once.
I tried to send the high byte and the low byte in different orders.
C Source Code
- static void LcdWriteReg(U16 Data) {
- uint8_t data[2];
- UC_ST7735_dcFLAG_t dcFlag = UC_ST7735_COMMAND;
- data[0] = (uint8_t)UTIL_HLP_LOW_BYTE_OF_INT16(Data);
- data[1] = (uint8_t)UTIL_HLP_HIGH_BYTE_OF_INT16(Data);
- UC_ST7735_writeSPI4Wire(&data[1], 1, dcFlag);
- UC_ST7735_writeSPI4Wire(&data[0], 1, dcFlag);
- }
- static void LcdWriteData(U16 Data) {
- UC_ST7735_dcFLAG_t dcFlag = UC_ST7735_DATA;
- uint8_t data[2];
- data[0] = (uint8_t)UTIL_HLP_LOW_BYTE_OF_INT16(Data);
- data[1] = (uint8_t)UTIL_HLP_HIGH_BYTE_OF_INT16(Data);
- UC_ST7735_writeSPI4Wire(&data[1], 1, dcFlag);
- UC_ST7735_writeSPI4Wire(&data[0], 1, dcFlag);
- }
- static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
- UC_ST7735_dcFLAG_t dcFlag = UC_ST7735_DATA;
- uint8_t data[2];
- int start_size = NumItems;
- while (NumItems--) {
- data[0] = (uint8_t)UTIL_HLP_LOW_BYTE_OF_INT16(pData[start_size-NumItems]);
- data[1] = (uint8_t)UTIL_HLP_HIGH_BYTE_OF_INT16(pData[start_size-NumItems]);
- UC_ST7735_writeSPI4Wire(&data[1], 1, dcFlag);
- UC_ST7735_writeSPI4Wire(&data[0], 1, dcFlag);
- }
- }
I didn't change LCD_X_Config()
C Source Code
- void LCD_X_Config(void) {
- GUI_DEVICE * pDevice;
- CONFIG_FLEXCOLOR Config = {0};
- GUI_PORT_API PortAPI = {0};
- //
- // Set display driver and color conversion
- //
- pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);
- //
- // Display driver configuration, required for Lin-driver
- //
- LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
- LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
- //
- // Orientation
- //
- Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y;
- GUIDRV_FlexColor_Config(pDevice, &Config);
- //
- // Set controller and operation mode
- //
- PortAPI.pfWrite16_A0 = LcdWriteReg;
- PortAPI.pfWrite16_A1 = LcdWriteData;
- PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
- PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
- GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16);
- }
The code I run is:
Source Code
There is no Compile-Error and the Watch Dog does not cause a problem.
The problem is that the display stays white.
I noticed that the command number which the flexchain driver sends over spi does not match the excpeted numbers from the St7735 datasheet.
I debugged the SPI method. The follwing commands and data got sent.
- a command with 0x00 as the high byte
- a command with 0x03 as the low byte. As far I know there is no command number 3 for theSTt7735
- data with 0x00 as the high byte
- data with 0x00 as the low byte
- a command with 0x00 as the high byte
- a command with 0x50 ('P') as the low byte.
- data with 0x00 as the high byte
- data with 0x00 as the low byte
- a command with 0x00 as the high byte
- a command with 0x51 ('Q') as the low byte.
- data with 0x00 as the high byte
- data with 0x63 as the low byte
- a command with 0x00 as the high byte
- a command with 0x52 as the low byte.
- data with 0x00 as the high byte
- data with 0x00 as the low byte
...
- after a while with more alternating commands and data there is just data with 0x00
Did I forget to config something?
Mit freundlichen Grüßen / Best regards
Lukas Hauser
The post was edited 2 times, last by lukas.hauser ().