Commit Graph

86 Commits

Author SHA1 Message Date
eeeck d5fd649325 Print messages on CAN error and disable IRQ 2026-07-05 22:30:31 +02:00
eeeck 79ef4c5fdb Update CAN bus tasks 2026-07-05 22:29:32 +02:00
eeeck 03fec5ff34 Initialize DMA and GPIO first 2026-07-04 18:23:07 +02:00
eeeck 76f6526036 Initialize CAN peripherals as GPIO pins 2026-07-04 18:22:36 +02:00
eeeck ff1335b0dc Use software counter in error handler after HAL is deactivated 2026-07-04 18:22:22 +02:00
eeeck c9f735acd9 Initialize USART1 as first peripheral 2026-06-24 18:54:21 +02:00
eeeck e14a98eba4 Add error callback to recover from UART deadlock, use async UART
transmit
2026-06-24 17:40:26 +02:00
eeeck b55bd9468f Use better logging codes 2026-06-24 17:15:34 +02:00
eeeck 334295e1cd Disable UARTrx 2026-06-24 17:03:22 +02:00
eeeck 89cd1e00d0 Remove whitespace 2026-06-24 08:11:11 +02:00
eeeck 591a96cf6d Increase CAN task size 2026-06-24 08:10:59 +02:00
eeeck 2be0f0370e Use larger baudrate 2026-06-24 08:10:49 +02:00
eeeck 58c4b66f34 Try different prescalers 2026-06-24 08:10:41 +02:00
eeeck 9f1e7ba267 Move debugger connection check to main 2026-06-18 13:24:33 +02:00
eeeck b9c371ed58 Initialize semaphore with count of 1 2026-06-18 13:05:43 +02:00
eeeck 11e50b05e4 Make debug print safer by checking if ST-Link debugger is connected 2026-06-18 09:10:00 +02:00
eeeck 691d5dc1ea Fix baudrates
- They were wrongly calculated on 168MHz but APB1 bus is at 42 MHz (168
  / 4)
2026-06-18 08:49:52 +02:00
eeeck 4967cd9b32 Add USART DMA in Normal mode from CubeMX 2026-06-18 08:29:21 +02:00
eeeck 907c0b170d Move to PFP block in main.c and use more standard logic 2026-06-17 20:33:22 +02:00
eeeck 60849ebb78 Testing: SDIO stuff deactivated until implemented
- Goes into error handling
2026-06-17 20:32:36 +02:00
eeeck aeb553994c Update LED struct 2026-06-17 20:14:56 +02:00
eeeck 5e28758a5e Use serial mode instad of JTAG 2026-06-17 20:09:45 +02:00
eeeck 9980dafb5c Initialize JTAG hardware
- To debug with ST-Link
2026-06-17 18:27:55 +02:00
eeeck 84ea393dd6 Implement ITM debug via ST-Link
- Enable Instrumentation Trace Macroblock
- Remove PB3 initialization conflict with ITM
- Add a bunch of debug prints
2026-06-17 18:04:48 +02:00
eeeck f7581d49ce Fix task priority with correct handles 2026-06-16 23:06:35 +02:00
eeeck cd0b412d74 Remove whitespace 2026-06-16 22:35:04 +02:00
eeeck 24e100cae6 Use better name for CAN listener task function 2026-06-16 22:34:55 +02:00
eeeck 7d5b3f9be2 Increase all queue sizes and double the UART queue 2026-06-16 22:29:00 +02:00
eeeck dfc116b2e9 Fix linker error by moving RTOS thread declaration to global scope 2026-06-16 22:12:40 +02:00
eeeck 59b0aca092 Refactor: implement data relay from vCANLoggerListen to xUARTQueue
- No RTOS event, just queue put and get: cleaner way to send data and
  more clear separation of concerns
2026-06-16 22:09:49 +02:00
eeeck 0d0e485193 Initialize cansend headers 2026-06-16 19:34:12 +02:00
eeeck 76628dec90 Initialize UART task and semaphore and CAN event flags 2026-06-16 19:10:53 +02:00
eeeck af4ce2f9e8 Remove unecessary MXCube comments 2026-06-16 18:01:54 +02:00
eeeck 34df5e51b7 Remove LED contexts
- Are now unnecessary with the move to task notification
2026-06-16 17:59:57 +02:00
eeeck 6446f5209b Remove semaphores in favor of task notifications
- Less overhead, simpler to manage
- Semaphores are apparently overkill for a simple blink timer
2026-06-16 17:56:11 +02:00
eeeck cc3a37ba4b Increase UART baudrate 2026-06-16 16:16:51 +02:00
eeeck 990a85c002 Enable UART interface from MXCube 2026-06-16 16:01:49 +02:00
eeeck 2c14d095f7 Better way to avoid race condition, only notification lives in CAN task
- Runs only once
- Only critical notification is inside task
- CAN message during boot will not be lost, instead put inside FIFO0
2026-06-15 14:30:35 +02:00
eeeck c1d2e65e20 Move to RTOS_THREADS
- ops...
2026-06-15 14:12:47 +02:00
eeeck ce85e473b3 Move before starting scheduler to avoid race condition
- If a CAN message arrives during boot time ISR will fire and try to put
  data into xCAN1RxQueue. At that time queue is NULL: calling RTOS APIs
  on NULL handles will cause a HardFault
2026-06-15 14:11:11 +02:00
eeeck ab8b68313b Transition from timer based to task based LED signal
- Remove RTOS timers
- Create LED task
- Avoid polling, instead wait for semaphore
2026-06-15 14:06:51 +02:00
eeeck ac212c4a0a Merge pull request 'Change headers with better copyright comments' (#13)
from code-licensing into j1939

Reviewed-on: erickahmed/j1939_logger#13
2026-06-14 21:36:45 +02:00
eeeck 3c66a39a5d Fix variable name mismatch 2026-06-14 21:27:10 +02:00
eeeck 19eefc288b Fix scope error by moving declaration 2026-06-14 20:48:11 +02:00
eeeck 17febf569a Use a more generic name as semaphore will be used by other tasks 2026-06-14 18:31:54 +02:00
eeeck 9d4d807cfb Fix race condition that could cause a hard fault 2026-06-14 16:21:55 +02:00
eeeck 5ec806ffea Add CMSIS include 2026-06-14 16:17:01 +02:00
eeeck 8777f742ac Move typedef to header 2026-06-14 16:15:33 +02:00
eeeck 4aafa81009 Change CODE BEGIN N value 2026-06-14 16:14:20 +02:00
eeeck ac16f8150e Use a more sensible number of semaphores 2026-06-14 16:10:18 +02:00