2024-07-21 10:49 PM
Hello, i am trying to configure the on-board TFT-LCD on STM32F429-Disc0 board and i want to do it without using HAL drivers, every tutorial on youtube or other platforms i see, are using CubeMX or HAL or both. I understand we need SPI5 to configure the ILI9341 peripheral (unlike the STM32F7 where only LTDC config is required), i feel there are less resources to -
1) understand the data sheet of the LCD peripheral, its way complicated for a beginner
2) understand the LTDC registers in the reference manual, and what default values should be put into them
3) creating functions to write something on the LCD screen, to draw and more, very complex and no one has explained them properly on youtube.
I know there is a CubeMX example available which shows stm logo on screen but it also uses HAL and is complicated to understand a proper code structure and the flow of the code and what to do and when.
Any suggestions/guidance?
2024-07-21 11:08 PM - edited 2024-07-21 11:12 PM
Hi,
>i want to do it without using HAL drivers,
Why ? Want more difficult challenge ?
1. Use Cube+HAL to get it working .
2. IF working, as you want, then replace the HAL_SPI_Transmit(&ILI9341_SPI_PORT...) with whatever you can do better or faster .
> understand the data sheet of the LCD
Right, you have to read and understand.
>creating functions to write something on the LCD screen
If want to see, how its done (by others ), look on git :
https://github.com/search?q=ili9341%20stm32&type=repositories
Look, how they do - or copy a lib, that seems fine for you, and try to adapt/ get it running.
Then it might look like my ILI9341 TFT + F303 here:
:)
2024-07-21 11:21 PM
Hi, thanks for responding,
Till now i have done all the peripherals ADC,UART,SPI, DMA etc without any drivers on ARM-keil only.
>i want to do it without using HAL drivers,
Why ? Want more difficult challenge ?
where i am learning ATM, they dont use any HAL or any other drivers at all, they have built their own bare-metal library and keep using the functions, but i want to learn it from scratch and in-depth.
As you know in real-life industries, they refrain from using HAL because of memory constraints and cost issues so its better not to learn the controller using HAL is what i feel.
2024-07-21 11:35 PM
Ok, so try and learn, how to do it bare-metal . :)
maybe look here, to see, how its done:
https://github.com/***ci/stm-ILI9341-spi
2024-07-22 03:23 AM
@sk12 wrote:understand the data sheet of the LCD peripheral, its way complicated for a beginner
you can't have it both ways!
The whole point of a HAL is to save you having to delve deeply into the arcane inner workings of the hardware details - especially complicated ones like LCD controllers.
If you don't want to use the HAL, then you must be prepared to put in the time & effort to understand the hardware details.
@sk12 wrote:in real-life industries, they refrain from using HAL because of memory constraints and cost issues
That's not (necessarily) true. Many will use the HAL to save the effort (ie, cost) of reinventing this wheel.
2024-07-22 03:29 AM
You don't want to use HAL? At least inspire from it and gain some time you will spent on this big effort!
2024-07-22 05:43 AM
Hello, thanks for replying.
Where i am training ATM, they build embedded solutions for medical industry, so, the senior devs here told me not to use HAL to learn the controller as they feel a beginner needs to "delve deeply" as you said. they also said that HAL uses up a lot of memory which is another reason why they dont use it. i already have worked on assembly a bit in college(8085,8051) and theoretically for pic16f. so features the controller offers isnt entirely new for me and i did have an advantage here. once i learn the basics i feel i can then use HAL and all other libraries which would make the work easier, i dont really know how it works in other industries. but yes i have been putting efforts and time to understand the internal working of the discovery board. the point i am trying to make is there is very few info available on the forums as well as youtube etc. on the "bare-metal" way i guess everyone uses CubeMX and HAL..
if you know how development happens in any industry please, i'm all ears.
Thanks
2024-07-22 06:00 AM
Hello, thanks for replying
i do understand HAL is easier and time-saving, but i really do want to understand the internal processes as my seniors have instructed me to and try to have the as best of an understanding about the controllers as i can!
2024-07-22 06:09 AM - edited 2024-07-22 06:45 AM
Hello,
I said, you need to inspire from it not to use it because doing all the staff from the scratch is not the best way to follow as a beginner. Believe me is hard and you will lose a considerable time. At least look at the HAL implementation and extract the registers accesses with the correct order. You will for sure gain a considerable time.
2024-07-22 06:14 AM
@SofLit wrote:I said, you need to inspire from it not to use it
Indeed.
@sk12 This is essentially what @AScha.3 said, too.
Learn to use your IDE's code browsing facilities to see where things are defined and where they're used.
I find stepping in the debugger can be a good way to follow the execution flow through the HAL code.
Also study the HAL User Manual.