4.1k views
in System Integration by
Hello all,

Is it possible to integrate an Embedded Wizard Studio project in System Workbench for STM32 ? I am using the Evaluation Edition of the wizard studio.

Best Regards,

Valentin

2 Answers

+4 votes
by
 
Best answer
Hello Valentin,

Example for STM32F746DISCO, Enjoy!

https://drive.google.com/open?id=0B8plE2t3z9EESVhHcGJ5YlpZSkU

This is my awkward attemp to combine STM32CubeMX, SystemWorkbench and Embedded Wizard in one project. Seems working. Yet I believe TARA engineers can do better...

With regards
by

Hi Alex

Are you using with the Evaluation edition of the Embedded Wizard Studio? Also, can't understand whether your folder Tara in the Src directory of tara1 project is generated by the Studio for your project or it can be used by any project. Can you please describe the complete algorithm for inserting the Embedded Wizard Studio's project into System Workbench ?

Thank you very much!

Valentin

by
Hi Valentin,

I am using evaluation edition.

Src/Tara is library and corresponding to library files. This part is fixed and not editable.

Src/Tara_generated is folder for files which is generated by EW Studio. Now you just point it as the destination folder for generating in EW Studio. And then you make Refresh in Sustem Workbench and then build and run..

If you want to do it for other board from the scratch then look on the project setting in the SW4STM32: includes, symbols and libraries linked (that is makefile reproduction).

Have problems with example running?

BR, Alex
by

Alex,

Seems like the example is flashing correctly on the board (STM32F746G-DISCOVERY), but none of the touch functions are active. Also after every reset some unexpected colour lines appear on the screen.

I decided to make my own example. I used the "Hello World" example project of the Wizard Studio ( https://drive.google.com/drive/folders/0B3NQEG6DmhfVbEp6Q08xeTBVYTQ ) which I tried to add in a blank System Workbench project. In the Src directory of the AC6 project I inserted the Tara library, the generated files after the building of the Wizard Studio project, I created a folder called Backup in which I just putted the .bak file of the HelloWorld project and finally inserted the main.c file of HelloWorld. When I attempt to build the AC6 project I get error messages showing that some of the header files in the Tara library cannot be found (for example ewrte.h and tlsf.h). I'm still working on that issue.

Thanks again for the continious support!

Valentin

by
This stripes are strange... it looks as SDRAM problem. But in the same time this code works well on my exactly the same board. Can you check board? - donload st demo with graphics (from CibeMX repository).

I think TARA engineers selected not best choise to use BSP of the DISCO board, in the same time they have their own ew_bsp. Moreover, their ew_bsp is based on CubeMX generated files. Then when I add CumeMX compatibility there are added 3rd BSP (Cube init code) with the same names, and this crasy mix of BSPs is really not convinient.

Returning to our case. In my example I renamed main.c to tara.c to destinguish some how cube and tara. And keep them as is so far. Change only generated code folder contend, then rebuild. I also use FreeRTOS in my example, this can confuse you but you can easely remove is just ranning tara_main from main after init code, generated by cube.

BR

Alex
by
Please try another settings for SDRAM. Seems it is wrong settings in ST's BSP.

  /* Timing configuration for 100Mhz as SD clock frequency (System clock is up to 200Mhz) */
  Timing.LoadToActiveDelay    = 2;
  Timing.ExitSelfRefreshDelay = 6;
  Timing.SelfRefreshTime      = 4;
  Timing.RowCycleDelay        = 6;
  Timing.WriteRecoveryTime    = 2;
  Timing.RPDelay              = 2;
  Timing.RCDDelay             = 2;

  sdramHandle.Init.SDBank             = FMC_SDRAM_BANK1;
  sdramHandle.Init.ColumnBitsNumber   = FMC_SDRAM_COLUMN_BITS_NUM_8;
  sdramHandle.Init.RowBitsNumber      = FMC_SDRAM_ROW_BITS_NUM_12;
  sdramHandle.Init.MemoryDataWidth    = SDRAM_MEMORY_WIDTH;
  sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
  sdramHandle.Init.CASLatency         = FMC_SDRAM_CAS_LATENCY_2;
  sdramHandle.Init.WriteProtection    = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
  sdramHandle.Init.SDClockPeriod      = SDCLOCK_PERIOD;
  sdramHandle.Init.ReadBurst          = FMC_SDRAM_RBURST_ENABLE;
  sdramHandle.Init.ReadPipeDelay      = FMC_SDRAM_RPIPE_DELAY_2;
by
Hi Alex,

just one comment concerning "ew_bsp": We did not implement the ew_bsp files to provide "another" Board Support Package - the idea is to have an abstraction to the underlying system. With other words: it is the glue between Embedded Wizard and the Board Support Package.

As soon as the underlying BSP provides a certain service, it is used within the ew_bsp files - and when a certain service is missing, HAL drivers are directly used.

Best regards,

Manfred.
by
Hi Alex, i want to change the target to stm32f769i disco, what do i have to chanage? or do i have to make the project from the scracth?

I'm trying to load your project on my board but, i couldn't find the .hex or .bin, so i tried to
by

Jsuepez hi,

I transfered template to STM32F429-DISCO, and I did it from scratch. Because bsp, ew_bsp all are changed. I can give main hints:

0. make template of the project using for example STM32CubeMX

1. Followinf makefile in template folder copy all needed files into Src folder of System Workbench file system. Generally for all templates this is more or less same set of files.

2. Then according makefile add same symbols to the project settings (Project properties->C/C++ Build->Settings->ToolSettings->MCU GCC Compiler->Symbols)

3. According makefile add folder names in Includes.

4. In MCU GCC Linker->Libraries just copy the content from my project to your.

5. Then you will get errors connected with CubeMX bsp and EW bsp same names of init functions. Try to replace CUbeMX initialization... Otherwize you will lose some peripheral for cube. So, here you should play a bit..

Generally that is all.

And I am still asking support people: please make all templates System Workbench compatible, please! 

To make binary there should present PostBuild command (or you can do it mannually from cmd line).

arm-none-eabi-objcopy -O binary "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.bin" && arm-none-eabi-size "${BuildArtifactFileName}"

I don't know why on SystemWorkbench bin file is not generated, seems there are no this tool in the external builder package.

by

Thanks for the support Alex2051.

When you create the project on Mxcube, you included the LCD? i mena You took the Discovery as target or you took an specific chip?

When you talk about the makefile, is the one which is inside the STM32F769-Discovery\Examples\Template or another one?

 

Sorry if these are newbie question, but i have tried many times and i've failed..

 

 

by

Hi Alex2051.

Finally i found how to setup the project, now, in order to flash the device with he code C and the file generate by the Embedded Wizard, which are the steps?

You flashed it from the embedded wizard?or you did by st-links?

 

by
And also i'm confused because you have 2 main file ... tara.c and main.c what that is mean?What the right main?
by

 Jsueprez, hi

It is supposed to be flashed (as well as debugged) in System Workbench (through st-link for sure).

in my project main.c contains main() which was generated bt CubeMX. Further Tara.c contains "old main" which I call as just one FreeRTOS task. That is it.

I you have problem with this porting I can try to do it for you. Just to be sure: the main idea is to make project System Workbench compatible, is that what you need? :-)

by
Yes, what i need really is to work the C code on my eclipse IDE.I could integrate and compile the project with all .c and .h file necesary to control the display.Also i have a project in embedded wizard. But i'm having problem when i run the code, the display show like if it was broken.

When i do the debug, i can see that the code stop in Infinite_Loop all the time.

If you can help me it will be very gratefull...
by
if you have the picture already (even like on broken screen) it seems as gui is running. The issue could be in SDRAM initialazation and in LCD initialization part.

ps: check your message box.
by
Hallo,

i tried to make a template for the STM32F469 Discovery Board. I followed the steps from above but my code/project is not working. In the System Workbench i get the following errors if i try to build it:
undefinded references and more undefined references of some Objects generated form Embedded Wizard.
All the undefined references are in the generated Code of Embedded Wizard. I don't know why this is happening, because i think i have all necessary includes  included. I hope somebody can help me with this problem.
Here is a Download Link to the template:
https://www.dropbox.com/s/x6dwm1ox96voo09/EmbWizCode_ExampleDeviceIntegration.zip?dl=0
by

I figured out my problem! It was a wrong setting in the CubeMx file. Now i have a example which can be built in the system workbench. But the Display is still not working see the following picture:

I think it is a problem of the clock setting in my project. Here is a picture of the Clock Setting in Cube MX:

I made in the CubeMX also the DCMI (Slave 8bits External Synchro), DMA2D, DSIHost (Adapted Command Mode), FMC (SDRAM1 -  SDCKE0+SDNE0 - 4 banks - Adress 13bits - Data 16bits), I2C1, I2C2, I2S2, LTDC (RGB565 [16bits] - DSI mode), QUADSPI, RTC.

I use Free RTOS and my main and this is my main:

int main(void) {

    /* USER CODE BEGIN 1 */

    /* USER CODE END 1 */

    /* MCU Configuration----------------------------------------------------------*/

    /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
    HAL_Init();

    /* USER CODE BEGIN Init */

    /* USER CODE END Init */

    /* Configure the system clock */
    //SystemClock_Config();
    /* USER CODE BEGIN SysInit */
    /* initalize system */
    EwBspConfigSystem();

    /* configure system tick counter */
    EwBspConfigSystemTick();

    /* configure realtime clock */
    EwBspConfigRealTimeClock();
    /* USER CODE END SysInit */

    /* Initialize all configured peripherals */
    MX_GPIO_Init();
    MX_FMC_Init();
    MX_LTDC_Init();
    MX_DCMI_Init();
    MX_QUADSPI_Init();
    MX_I2C1_Init();
    MX_I2C2_Init();
    MX_I2S2_Init();
    MX_RTC_Init();
    MX_USART6_UART_Init();
    MX_DMA2D_Init();
    MX_DSIHOST_DSI_Init();

    /* USER CODE BEGIN 2 */
    BSP_SDRAM_Init();

    /* configure LED */
    EwBspConfigLed();

    /* initialize serial interface for debugging and connect xprintf module */
    EwBspConfigSerial();
    xdev_out(EwBspPutCharacter);

    //extern main_old(void);
    //main_old();
    /* USER CODE END 2 */

    /* USER CODE BEGIN RTOS_MUTEX */
    /* add mutexes, ... */
    /* USER CODE END RTOS_MUTEX */

    /* USER CODE BEGIN RTOS_SEMAPHORES */
    /* add semaphores, ... */
    /* USER CODE END RTOS_SEMAPHORES */

    /* USER CODE BEGIN RTOS_TIMERS */
    /* start timers, add new ones, ... */
    /* USER CODE END RTOS_TIMERS */

    /* Create the thread(s) */
    /* definition and creation of defaultTask */
    osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
    defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);

    /* definition and creation of TaskEmbWiz */
    osThreadDef(TaskEmbWiz, StartTaskEmbWiz, osPriorityIdle, 0, 1280);
    TaskEmbWizHandle = osThreadCreate(osThread(TaskEmbWiz), NULL);

    /* USER CODE BEGIN RTOS_THREADS */
    /* add threads, ... */
    /* USER CODE END RTOS_THREADS */

    /* USER CODE BEGIN RTOS_QUEUES */
    /* add queues, ... */
    /* USER CODE END RTOS_QUEUES */

    /* Start scheduler */
    osKernelStart();

    /* We should never get here as control is now taken by the scheduler */

    /* Infinite loop */
    /* USER CODE BEGIN WHILE */
    while (1) {
        /* USER CODE END WHILE */

        /* USER CODE BEGIN 3 */

    }
    /* USER CODE END 3 */

}

I know that the issue appears when the function HAL_LTDC_ConfigLayer(&hltdc_handle, &LayerConfig, LAYER_INDEX ) in ew_bsp_display.c (Line 329) is called.

I hope that someone can help me with this issue. Thanks guys.

By the way in the Linkto the new version:
https://www.dropbox.com/s/hxzuxlmcyk9mrme/Template.zip?dl=0&m=

0 votes
by
Here is an actual template for the STM32F469I-Discovery Board:
https://ask.embedded-wizard.de/1335/freertos-system-integration-of-embedded-wizard

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...