2025-04-12 5:44 AM - last edited on 2025-04-12 6:49 AM by mƎALLEm
Hi. i have a 743i eval board . and i've gone through the touch gfx examples (i'm not experierenced in c++ ) and i've found other examples ive worked though .. The project i'm on revolves around receiving CAN data and displaying on LCD and also touch screen button / external buttons that send messages back.
i've taken my button press example (controllers tech adapted to my board) this turns the display backlight on and off - so i know i can have external control. i also have a a can example i've split in to a can.c can.h and added to the project (set up the interrups in cube ide and added the callbacks) .. but with breakpoints on the call back when i send a message nothing happends. After looking at webinars etc.. i'm guessing the rtos has got to schedule stuff so i may have to go back a step or 2 and re-look at those. but can't find the code to look at from the ST webinar - had display turning on external led and doing animation from a button . if anyone can shed light or offer some suggesting i'd be gratefull ..
John
2025-04-15 5:50 AM - edited 2025-04-15 5:56 AM
i have gone deeper in to tutorials ..
my little project can now display the potentiometer on the screen as a gauge and i can make an LED light from the screen plus change a progress bar via an external button. all this is to understand the program flow.
i've now added in CAN. functionality .. the Can set up and start is in StartDefaultTask and before the infinete loop. i have a call back in the code. in the ioc. i have FDCAN1 interrupt 0 enabled. The clock is ok going to the CAN (@25Mhz) and all the setting are ok for 1Mb/sec. when i send a message the call back isnt called (breakpoint in the call back ).I've placed an LED toggle in the call back as well ... so far nothing. Any pointers where to go ? i have a feeling i'm missing something.
2025-04-17 3:22 AM
after digging .. discovered that Pins were not set up in the cube mx ... one pic was wrong , hell knows how.
i now have the call back triggering when a message is received .
BUT still no transmit .. with a break point and a LED toggle added i can prove the task is running
void StartcanTask(void *argument)
{
/* USER CODE BEGIN StartcanTask */
TxData[0] = 0x55 ;
TxData[1] = 0x55 ;
/* Infinite loop */
for(;;)
{
if (HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader, TxData) != HAL_OK)
{
/* Transmission request Error */
Error_Handler();
}
osDelay(1000);
}
/* USER CODE END StartcanTask */
}
2025-04-17 3:49 AM
update .. when using fifo ... it helps to have your Tx Fifo Queue Elements Nbr NOT set to 0 !!