PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.29k stars 13.43k forks source link

H7/F7 UAVCAN bootloader implem #18683

Open TregliaRaphael opened 2 years ago

TregliaRaphael commented 2 years ago

Hi, I discovered uavcan bootloader for some of the board like can_gps_v1 for cuav and some others but i don't find any can bootloader for stm32H7 and F7. Is canbootloader exist for the H7/F7 target or is it still pending? There is all arch available for stm32 here but not h7 for now Can bootloader arch stm

Did you know if this was started Somewhere because i could help? Moreover, i dont find any specific canbootloader f7 build in makefile could you help me to find one?

I'm actually creating a fc which could match with canbootloader f7 or h7.

Thanks you !

dagar commented 2 years ago

STM32F7 is fully working, see boards/freefly/can-rtk-gps as an example. I haven't needed to look into STM32H7 yet, but it shouldn't be hard to extend.

TregliaRaphael commented 2 years ago

Thanks a lot :) I'll check in this way

TregliaRaphael commented 2 years ago

Could you just help me to identify the parts I need to do to achieve the H7 uavcan bootloader ? That's the first time I'm doing these kinds of things so I don't want to forget anything if possible. Should I just do the H7 arch of the uavcan bootloader? in this folder https://github.com/PX4/PX4-Autopilot/tree/master/platforms/nuttx/src/canbootloader/arch/stm

dagar commented 2 years ago

Could you just help me to identify the parts I need to do to achieve the H7 uavcan bootloader ? That's the first time I'm doing these kinds of things so I don't want to forget anything if possible. Should I just do the H7 arch of the uavcan bootloader? in this folder https://github.com/PX4/PX4-Autopilot/tree/master/platforms/nuttx/src/canbootloader/arch/stm

You could start by taking a look at what was added for F7 support along with the Freefly RTK GPS board. https://github.com/PX4/PX4-Autopilot/pull/17553

The main difference that comes to mind is that H7 will have a different minimal CAN driver. https://github.com/PX4/PX4-Autopilot/blob/70d5377aa7815149fc799630cc3bb7a97f4cd762/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/drivers/can/driver.c

TregliaRaphael commented 2 years ago

When you say different minimal CAN, do you just mean adapting clock speed/parameters and stm addresses ?

dagar commented 2 years ago

When you say different minimal CAN, do you just mean adapting clock speed/parameters and stm addresses ?

The CAN driver for stm32h7 is a bit different than stm32f4/f7 (bxcan). This is the minimal CAN driver in the bootloader for stm32f7. https://github.com/PX4/PX4-Autopilot/blob/70d5377aa7815149fc799630cc3bb7a97f4cd762/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/drivers/can/driver.c

You could take a look at the full fledged UAVCAN drivers to see the differences between them. https://github.com/PX4/PX4-Autopilot/tree/70d5377aa7815149fc799630cc3bb7a97f4cd762/src/drivers/uavcan/uavcan_drivers

TregliaRaphael commented 2 years ago

Hi, I had the time to work on it since the last time we discuss, and I'll like to know how can I share you my work through branches / pushes on the px4 github?

sanyanosnikov commented 1 year ago

@TregliaRaphael Hi. If you have already made a canbootloader, could you share it? Thanks

TregliaRaphael commented 1 year ago

Hi, I'hv done my proper can bootloader outside of the PX4 ecosystem because i prefer to control everything i'm doing. I won't share it sorry. There was too much work for me as a newby on Nuttx because the H7 is not fully implemented on the driver side or the difference between F7 and H7 were too different for me to take the risk to modify important things.

I had a can bootloader branch that compile but there still was a non negligeable job to do to make it works. It's just an hour work.