Hello!
First of all, the WaveShare Open746-C development board is a really popular hardware for starting with STM32F4 micro controllers. Many customers are using the same hardware set as you, that is one reason why we already have experience with this board and are able to give you a short advice and project for this board.
Normally, this is some of our payed services which we are offering. For generating a build environment for your complete self-developed hardware, please contact us.
To bring up an Embedded Wizard UI on your WaveShare board you have to do just a few steps:
1. Download an Embedded Wizard Build Environment
Find a similar board from our getting started homepage and download a Embedded Wizard Build Environment. The selected board should have a similar microprocessor and similar connection type to the display. For example, your WaveShare board has an 24 bit parallel interface and a F4 controller. The best choice here is an STM32F746-Discovery board. This discovery board has mounted exactly the same processor and also a 24 bit parallel connected display. In the downloaded Embedded Wizard Build Environment you can find projects for several IDEs like GCC, EWARM, IAR and TrueSTUDIO. These projects are preconfigured with all necessary settings for running an Embedded Wizard UI instantly.
2. Remove all dependencies to the BSP
All target specific files you can find in the TargetSpecific folder located in your downloaded STM32746-Discovery Build Environment. Now you have to remove all dependencies to the ST discovery board at the project property ‘Paths and Symbols’. Moreover you have to remove all BSP files at the project explorer and all code dependencies to these files. This ‘naked’ project is the base to insert all initialisation sequences for your WaveShare board.
Note: The WaveShare board has not mounted an external QSPI flash, so it is important to set the Symbol ‘EW_USE_QSPI_FLASH’ value to 0.
3. Check and change the defines at main.c
At the beginning of the main.c file, located in the ‘Application/Source’ folder, are some really important defines which containing the information about the framebuffer start address, display resolution and memory pool size and location. You should locate your framebuffer at the beginning of your flash section (0xD0000000) and set your resolution to 1024 as width and 600 and height as you can see below.
#define FRAME_BUFFER_ADDR (void*)((uint32_t)0xD0000000)
#define FRAME_BUFFER_WIDTH 1024
#define FRAME_BUFFER_HEIGHT 600
The memory pool is needed as working memory for the Embedded Wizard UI engine. We locate them directly after the framebuffer and give them remaining memory of the flash. Here the adapted defines for the memory pool.
#define MEMORY_POOL_ADDR (void*)((unsigned char*)FRAME_BUFFER_ADDR + FRAME_BUFFER_SIZE)
#define MEMORY_POOL_SIZE 0x800000 - FRAME_BUFFER_SIZE - DOUBLE_BUFFER_SIZE
4. Insert your initialisation sequences for the WaveShare board.
As already mentioned, just the files under ‘TargetSpecific’ have dependencies to the hardware. Normally you only have to change code in these files. For example, for your WaveShare board it is necessary to adapt the System Clock, USART, SDRAM, MPU, LTDC, Touch driver initialisation. We recommend to do this in the same order as here. We found all information about the initialisation in the examples from the WaveShare tutorial homepage. Please note that the following code are not containing the content of the whole BSP file, just the important changes or extensions.
• System clock in ew_bsp_system.c
Download as text file.
• USART in ew_bsp_serial.c
Download as text file.
• SDRAM in ew_bsp_serial.c
Download as text file.
• MPU in ew_bsp_system.c
Download as text file.
• LTDC in ew_bsp_display.c
Download as text file.
• Touch
Download as text file.
Note: You can download the new touch driver from WaveShare’s tutorial homepage. This driver includes the (bit banged) I2C implementation and configuration for the WaveShare Open746I-C. Please include them to your project.
Step 5: Resize your UI Application and generate the Code
Therefore please use the Embedded Wizard documentation here.
Step 6: Run
The ST-Link V1 is a preconfigured flashing device in TrueSTUDIO. How to use them, you can find out with the manual from Atollic.
Step 7: Cheating
If your project does not work, you can download here my project for the WaveShare Open746-C developing board. This project was created with Embedded Wizard Version 9.00
Kind Regards
Tim