2024-12-16 08:07 AM
Hello!
I have developed a firmware for the STM32H745 where I have communication between the two cores. I am using a specific ring buffer library and the semaphore method.
Meaning:
First core gets the semaphore, puts something into the shared memory, releases the semaphone, second takes the semaphore, reads the data etc etc.
All in all, that works very nicely.
I just went and developed a bootloader, because I wanted to enable flashing via a specific protocol. It works and boots the application firmware. But, unfortunately, the core communication doesn't work.
I am not sure what could be the problem as the shared memory is at 0x38000000, which is not deleted or touched via the bootloader.
The bootloader sits at 0x08000000 and 0x08100000; The application sits at 0x08020000 and 0x08120000;
What are some things that are connected to the openamp and 0x38000000 memory that could prevent it from working.
I am getting a confirmation that the buffer was written, but on the other core I am not getting a reading that anything is available.
Would there be anything colliding with the semaphore, or the bootloader not deiniting some things?
2024-12-16 08:19 AM
I added more deinit functions, and it works. I guess something was blocking...
static void goto_application(void) {
printf("Gonna Jump to Application\r\n");
void (*app_reset_handler)(void) = (void*)(*((volatile uint32_t*) (0x08020000 + 4U)));
// Deinitialize UART4
HAL_UART_DeInit(&huart4);
// Deinitialize FDCAN1
HAL_FDCAN_DeInit(&hfdcan1);
// Deinitialize TIM3
HAL_TIM_Base_Stop(&htim3);
HAL_TIM_Base_DeInit(&htim3);
// Disable NVIC interrupts
HAL_NVIC_DisableIRQ(UART4_IRQn);
HAL_NVIC_DisableIRQ(FDCAN1_IT0_IRQn);
HAL_NVIC_DisableIRQ(FDCAN1_IT1_IRQn);
HAL_NVIC_DisableIRQ(TIM3_IRQn);
// Turn off peripheral clocks
__HAL_RCC_UART4_CLK_DISABLE();
__HAL_RCC_TIM3_CLK_DISABLE();
HAL_RCC_DeInit();
HAL_DeInit();
__set_MSP(*(volatile uint32_t*) 0x08020000);
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
/* Jump to application */
app_reset_handler(); //call the app reset handler
}