Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [stm32] F469 disco hardware rev b08 display driver nt35510 #1003

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

hshose
Copy link
Contributor

@hshose hshose commented Apr 16, 2023

First attempt to fix #1002 by using the ST driver for nt35510.
This is for the STM32F469 example in examples/stm32f469_discovery/display

  • make driver work (hardware)
  • make nt35510/otm8009a driver configurable with lbuild board revision

@hshose hshose changed the title [WIP] [f469disco] hardware rev b08 / driver nt35510 wip [WIP] [stm32] F469 disco hardware rev b08 display driver nt35510 Apr 16, 2023
@hshose
Copy link
Contributor Author

hshose commented Apr 16, 2023

Display is not starting yet 😢

Also, It seems that the touch driver is slightly different version in B-08: FT6336U... 😭

@@ -14,7 +14,7 @@
def init(module):
module.name = ":board:disco-f469ni"
module.description = FileReader("module.md")
# Revisions = [b-03, b-02, b-01]
# Revisions = [c-01, b-08, b-03, b-02, b-01]
Copy link
Member

@rleh rleh Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remenber correctly the first revision in the list is the "default" revision. Not sure if we should change the default revision to C-01 (yet)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not (yet)?
Also - do you happen to have one of the b-08 or c-01 revision boards, too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you happen to have one of the b-08 or c-01 revision boards, too?

Not yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok :-D I just ordered a second one - just to make sure, that my first display isn't defective :-D

Comment on lines 330 to 334
case NT35510_FORMAT_RGB888 :
/* Set Pixel color format to RGB888 */
dsi_write_command(1, nt35510_reg37);
break;
default :
/* Set Pixel color format to RGB888 */
dsi_write_command(1, nt35510_reg37);
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case NT35510_FORMAT_RGB888 :
/* Set Pixel color format to RGB888 */
dsi_write_command(1, nt35510_reg37);
break;
default :
/* Set Pixel color format to RGB888 */
dsi_write_command(1, nt35510_reg37);
break;
case NT35510_FORMAT_RGB888 :
default :
/* Set Pixel color format to RGB888 */
dsi_write_command(1, nt35510_reg37);
break;

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I basically generated the code using CubeMX and then reformatted it. That's why there's a new copyright header in the middle of it. I never read the datasheet or understood any of it tbh. I also have a feeling that there is some pixel data offset mistake in the original driver, I think there are two pixels in the top left and one pixel in the bottom right that have the wrong color, but I never could fix it. Maybe it was just my display who knows, MIPI-DSI is basically magic.

src/modm/board/disco_f469ni/board.cpp Outdated Show resolved Hide resolved
@hshose hshose force-pushed the fix/stm32f469-disco-B08-display branch from 54c7883 to 085e43f Compare April 20, 2023 20:47
@hshose
Copy link
Contributor Author

hshose commented Apr 20, 2023

I basically generated the code using CubeMX and then reformatted it. That's why there's a new copyright header in the middle of it. I never read the datasheet or understood any of it tbh. I also have a feeling that there is some pixel data offset mistake in the original driver, I think there are two pixels in the top left and one pixel in the bottom right that have the wrong color, but I never could fix it. Maybe it was just my display who knows, MIPI-DSI is basically magic.

Well thats exactly what I am trying at the moment - and failing. I'm still not even sure my discovery board works (I have not managed to compile and flash an ST example that would bring up the display...)

@hshose hshose marked this pull request as draft May 2, 2023 21:52
@hshose hshose force-pushed the fix/stm32f469-disco-B08-display branch from 085e43f to 31e1ab3 Compare May 15, 2023 23:38
@hshose
Copy link
Contributor Author

hshose commented May 17, 2023

@rleh For documentation; managed to generate ST example with TouchGFXDesigner (the experience was quite traumatizing) which brings up the display marked DK32F469I$AU1.

Picture

image

Went through the ST code - the reformatted nt35510 seems correct, however there are differences with the DSI settings on the STM side. Updated these, but still no image shown.

Debugger says
Display NT35510 Error Interrupt Flag LPWRE (0x80 in DSI->ISR[1])
image

// Select the color coding for the wrapper
DSI->WCFGR = ColorCoding << 1;
// DSI_VSYNC_RISING
DSI->WCFGR = DSI_WCFGR_VSPOL;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit odd. In Line 77, WCFGR is set to 0, then to ColorCoding <<1 and then to DSI_WCFGR_VSPOL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second assignment should probably be DSI->WCFGR |= DSI_WCFGR_VSPOL;.

Thanks for catching this and notifying here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

STM32F469I-DISCO display does not work on newer board revision (B-08)
4 participants