2025-08-26 12:54 AM
Hi Fellow Developers,
May be its the seizure which I recently went through or may there is actually some issue while trying to configure the peripherals on the disco board.
Be it USART or SPI even after selecting the core for a particular communication protocol on board i am unable to get an response over it. Earlier i was trying to configure SPI and read a external SD CARD over SPI but am unable to get an response over SPI.
I even checked pins over oscilloscope and had not clock or data over MISO or MOSI.
As mentioned at below pins.
Then i tried sending data over USART3 pins and had no response there either.
Green is Tx connected to Pin D0 which is Rx on STM board
Blue is Rx connected to Pin D1 which is Tx on STM board
And Orange is GND.
I know HW connections are right, provided for reference.
Also here is a basic code of USART transmit.
int main(void)
{
/* USER CODE BEGIN 1 */
uint8_t txData[] ="Hello M7-DISCO!\r\n";
/* USER CODE END 1 */
/* USER CODE BEGIN Boot_Mode_Sequence_0 */
#if defined(DUAL_CORE_BOOT_SYNC_SEQUENCE)
int32_t timeout;
#endif /* DUAL_CORE_BOOT_SYNC_SEQUENCE */
/* USER CODE END Boot_Mode_Sequence_0 */
/* USER CODE BEGIN Boot_Mode_Sequence_1 */
#if defined(DUAL_CORE_BOOT_SYNC_SEQUENCE)
/* Wait until CPU2 boots and enters in stop mode or timeout*/
timeout = 0xFFFF;
while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) != RESET) && (timeout-- > 0));
if ( timeout < 0 )
{
Error_Handler();
}
#endif /* DUAL_CORE_BOOT_SYNC_SEQUENCE */
/* USER CODE END Boot_Mode_Sequence_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 Boot_Mode_Sequence_2 */
#if defined(DUAL_CORE_BOOT_SYNC_SEQUENCE)
/* When system initialization is finished, Cortex-M7 will release Cortex-M4 by means of
HSEM notification */
/*HW semaphore Clock enable*/
__HAL_RCC_HSEM_CLK_ENABLE();
/*Take HSEM */
HAL_HSEM_FastTake(HSEM_ID_0);
/*Release HSEM in order to notify the CPU2(CM4)*/
HAL_HSEM_Release(HSEM_ID_0,0);
/* wait until CPU2 wakes up from stop mode */
timeout = 0xFFFF;
while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) == RESET) && (timeout-- > 0));
if ( timeout < 0 )
{
Error_Handler();
}
#endif /* DUAL_CORE_BOOT_SYNC_SEQUENCE */
/* USER CODE END Boot_Mode_Sequence_2 */
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
HAL_UART_Transmit(&huart2, txData, sizeof(txData), HAL_MAX_DELAY);
HAL_Delay(1000);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
I tried for both cores simultaneously M7 and M4. But received no response.
Is there a specific configuration which needs to be done to initiate the pins as required peripherals which i am missing?
2025-08-26 1:55 AM
Hello,
Not clear what the problem is and I don't see any code related to SPI. Are you testing in debug mode? if yes that's tricky in Dual core. Are you really using both cores at the same time in your example?
Start by toggling a LED first then move on to SPI/UART communication.