barebones expansion firmware
-
I am trying to develop a custom expansion board for the Duet mainboard using the CAN-FD bus. Is there some barebones firmware available for something like the Roto Toolboard?
Currently, we are trying to modify the Roto Toolboard firmware to work on an Adafruit Feather M4 CAN but have not yet succeeded in communicating with the 6HC mainboard. The Feather uses the 64-pin version of the same IC as the Roto Toolboard. Since the Feather uses different pins for connecting to the CAN transceiver, we have tried to alter SetPinFunction in CanInterface.cpp, but that also didn't work. It doesn't produce any errors, but the Feather just doesn't start communicating after the firmware has been uploaded. If someone has a tip, that would be awesome; anything could be helpful at this stage.
-
@Jords27 Did you flash the bootloader as well? I guess you need to modify that as well.
-
@Jords27 this MCU has two CAN peripherals and corresponding pairs of pins that can be used to connect CAN. The set of pins used by the Roto tool board depends on this definition in the config file for that board at Duet3Expansion.src/Config/TOOL1RR.h line 117:
constexpr bool UseAlternateCanPins = true;
Change that to
false
to use the other CAN peripheral.See also the config file for the EXP3HC build, which may be closer to your board.
-
@chrishamm and @dc42, thank you for your responses. I have not flashed the bootloader. When I upload the firmware, nothing seems to happen. When I upload the .bin file for the TOOL1RR board, nothing seems to happen, but when I upload a basic project controlling an LED using the same method, it does work. I have tried changing the pin declaration for CAN and changing UseAlternateCanPins = true to false, but that also didn't work. After that, I tried setting a pin high in the Platform::Init() function in Platform.cpp, and that also didn't do anything. I am now thinking that something else might be wrong, but I have not yet figured out what. I will keep looking into it and will let you know when I have figured it out.
-
This post is deleted! -
@Jords27 the binary files generated by Duet3Expansion projects are written to sit in flash memory above the bootloader, except for some of the debug variants and the no-bootloader variant. If you intend to program the firmware directly into the MCU without a bootloader then you will need to change the linker script file to target them to the bottom of flash memory instead. The linker scripts for SAME5x-based boards are in folder src/Hardware/SAME5x_C21/SAME5x.