Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:ewp [2024/10/07 12:36] – created darronprojects:ewp [2024/10/30 02:54] (current) – [STM32CubeH7 Demo] darron
Line 1: Line 1:
 ====ewp.py: Create Makefile from IAR project==== ====ewp.py: Create Makefile from IAR project====
 +
 +ewp.py converts as best it can IAR project files into GNU Makefiles.
 +
 +===Install===
 +
 +<code>
 +hg clone https://hg.kewl.org/pub/ewp.py
 +cd ewp.py
 +sudo make install
 +</code>
 +
 +===STM32CubeH7 Demo===
 +
 +==Fetch Source==
 +
 +<code>
 +git clone --recursive https://github.com/STMicroelectronics/STM32CubeH7
 +</code>
 +
 +==Enter Demo==
 +
 +<code>
 +cd STM32CubeH7/Projects/STM32H745I-DISCO/Applications/FreeRTOS/FreeRTOS_AMP_RTOS_BareMetal/
 +</code>
 +
 +==List Targets==
 +
 +<code>
 +ewp.py . EWARM/Project.ewp
 +STM32H745I_Discovery_CM4
 +STM32H745I_Discovery_CM7
 +</code>
 +
 +==Create Makefiles==
 +
 +<code>
 +ewp.py -p1 . EWARM/Project.ewp STM32H745I_Discovery_CM4 > Makefile.cm4
 +ewp.py -p1 . EWARM/Project.ewp STM32H745I_Discovery_CM7 > Makefile.cm7
 +</code>
 +
 +==Fix Makefiles==
 +
 +For each Makefile alter FIXME_CPU and FIXME_ABI for the CPU platform.
 +
 +In these cases it is cortex-m4, cortex-m7 and hard.
 +
 +Locate FIXME_LDS and ensure the correct linker script is selected and
 +then remove the FIXME_LDS text.
 +
 +Change paths to GCC from IAR in the FreeRTOS source and includes entries.
 +
 +==Patch Source (optional)==
 +
 +Apply this patch if you want the backlight to be disabled when running
 +the demo.
 +
 +<code>
 +--- CM4/Src/main.c.orig 2024-10-07 13:22:39.704687900 +0100
 ++++ CM4/Src/main.c      2024-10-07 13:24:31.570592100 +0100
 +@@ -74,6 +74,15 @@
 +      */
 +   HAL_Init();
 +
 ++  __HAL_RCC_GPIOK_CLK_ENABLE();
 ++  GPIO_InitTypeDef GPIO_InitStruct = {0};
 ++  GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
 ++  GPIO_InitStruct.Pull  = GPIO_NOPULL;
 ++  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
 ++  GPIO_InitStruct.Pin   = GPIO_PIN_0;
 ++  HAL_GPIO_Init(GPIOK, &GPIO_InitStruct);
 ++  HAL_GPIO_WritePin(GPIOK, GPIO_PIN_0, GPIO_PIN_RESET);
 ++
 +   BSP_LED_Init(LED1);
 +   BSP_LED_Init(LED2);
 +</code>
 +
 +==Build==
 +
 +<code>
 +make -f Makefile.cm4
 +make -f Makefile.cm7
 +</code>
 +
 +==Combine HEX==
 +
 +<code>
 +srec_cat build/STM32H745I_Discovery_CM7/STM32H745I_Discovery_CM7.hex -Intel build/STM32H745I_Discovery_CM4/STM32H745I_Discovery_CM4.hex -Intel -out Project.hex -Intel
 +</code>
 +
 +==Program==
 +
 +Program `Project.hex' with STM32CubeProgrammer (attempt using OpenOCD failed and needs investigation).
 +
 +==Notes==
 +
 +The demo FreeRTOS_AMP_Dual_RTOS initially runs ok and then stalls. This is due
 +to newlib memcpy causing an MPU unaligned memory hard fault.
 +
 +The FreeRTOS_AMP_RTOS_BareMetal demo works fine.
 +
 +/*
 +A work-in-progress port using this script can be found [[https://hg.kewl.org/pub/Ampere/|here]].
 +*/