kywwilson11 opened a new pull request, #16818:
URL: https://github.com/apache/nuttx/pull/16818

   ## Summary
   - Introduce new Kconfig options to enable FDCAN support on STM32H5:
     - `CONFIG_STM32H5_FDCAN` (global enable)
     - `CONFIG_STM32H5_FDCAN1` and `CONFIG_STM32H5_FDCAN2` (per-instance 
enables)
   - Fix the character driver symbol in `Make.defs` to use 
`CONFIG_STM32H5_FDCAN_CHARDRIVER`
   - Update clock configuration:
     - Correct PCLK1 prescaler bit definitions in `stm32h5xxx_rcc.h`
     - Add FDCAN clock source setup in `stm32h5xx_rcc.c` under 
`STM32_RCC_CCIPR5_FDCANSEL`
   - Add a new example defconfig for the Nucleo-H563ZI board under 
`boards/arm/stm32h5/nucleo-h563zi/configs/fdcan1`
   - Update Nucleo-H563ZI board support:
     - Adjust `PLL1Q` divider and frequency macros in `board.h. PLL1Q` output ≤ 
PCLK1 (APB1), so FDCAN input clock is valid` 
     - Refine ADC GPIO comments
     - Provide bring-up and CAN test code in `stm32_bringup.c` and `stm32_can.c`
     - Amend board Makefile to compile the new CAN example when FDCAN is enabled
   
   ## Impact
   - **Features:** CAN FD driver integration for STM32H5 series
   - **Build:** Adds Kconfig entries and a defconfig for FDCAN; no changes to 
existing configs unless FDCAN is selected
   - **Hardware:** Loopback test example for FDCAN1 on Nucleo-H563ZI; 
unaffected boards remain unchanged
   - **Compatibility:** Backward-compatible; FDCAN code only included when 
explicitly enabled
   - **Size:** Minor code footprint increase only when FDCAN support is enabled
   - **Documentation:** Updated Kconfig help text and provided example defconfig
   
   ## Testing
   - **Host:** Ubuntu 24.04, `arm-none-eabi-gcc` (GCC 10.2.1)
   - **Target:** Nucleo-H563ZI (`stm32h5:fdcan1_defconfig`)
   - **Before Change:**  
     - Built and ran `nucleo-h563zi:smp` and ADC example successfully
   - **After Change:**  
     1. `make defconfig` for `boards/arm/stm32h5/nucleo-h563zi:fdcan1` and 
`make`  
     2. Flash via ST-Link, start NSH  
     3. Verified driver registration and clock setup:  
        ```
        stm32_fdcaninitialize() returned FDCAN1
        FDCAN1 clock source configured
        Registered /dev/can1
        ```  
     4. Ran CAN example in loopback mode; observed continuous message RX/TX:  
        ```
        NuttShell (NSH) NuttX-12.10.0
        nsh> can
        nmsgs: 32
        min ID: 1 max ID: 2047
        Bit timing:
           Baud: 500000
          TSEG1: 8
          TSEG2: 1
            SJW: 1
          ID:    1 DLC: 1
          ID:    1 DLC: 1
        Data received:
          0: 0x00
          ID:    2 DLC: 2
          ID:    2 DLC: 2
        Data received:
          0: 0x01
          1: 0x02
          ID:    3 DLC: 3
          ID:    3 DLC: 3
        ... (output continues up to DLC 10) ...
        ID:   10 DLC: 10
          0: 0x24
          1: 0x25
          2: 0x26
          3: 0x27
          4: 0x28
          5: 0x29
          6: 0x2a
          7: 0x2b
          8: 0x00
          9: 0x00
          10: 0x00
          11: 0x00
        ```  
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to