AP_Periph 1.0.0 stable released

Good day,
im doing some test if i can connect my i2c rangefinder teraranger evo 60m on can node f103 but without success. On can node i flash the firmware f103 rangefinder and I’ve set as rangefinder type 24 aside also the parameters needed. I cannot read any value.

Hi @tridge , Thank you so much for this fantastic project. But when I try to build a f103-GPS’s bootloader with “Tools/scripts/build_bootloaders.py f103-GPS”, I get this error ,In file included from …/…/Tools/AP_Bootloader/can.cpp:25:0:
modules/libcanard/dsdlc_generated/uavcan/protocol/dynamic_node_id/Allocation.h:631:2: error: #endif without #if
#endif // __UAVCAN_PROTOCOL_DYNAMIC_NODE_ID_ALLOCATION
^~~~~
compilation terminated due to -Wfatal-errors.
how can I solve this ?

strange, I just tested master and it is fine. Are you using this command:
./Tools/scripts/build_bootloaders.py f103-GPS
?

Yes,maybe I should try to build with the latest code

Does anyone have any documentation/pointers on how to get Hobbywing esc telemetry through a f103-HWESC node?.
I compiled the fw and flashed the f103 with it and it seems to be functioning as it should, I get a new param in the node “ESC_NUMBER” (Have changed this)


I get no telemetry in missionplanner on the esc that is hooked up.

Any hints/tricks welcome
Thanks

For anyone else struggling to use a rangefinder via AP_Periph, I have found two essential steps to get this to work.

  • you need to set RNGFND1_ORIENT to 0 in the CAN node parameters;
  • the parameter RNGFND1_ADDR in the Ardupilot firmware (NOT on the CAN node) needs to match the sensor_id coming from the CAN node - which is 0 for AP_Periph.

This worked for me with mRo F303-Universal firmware with SF11/C on UART and airspeed sensor on i2c. I’ll update the wiki as I haven’t seen this info anywhere else.

I has taken me some time understanding my debugger tools, but I’ve finally been able to track down my issue in using AP_Periph bootloader with generic software targets (in my case using Arduino IDE and Arduino_Core_STM32).

I used a J-Link and Segger Ozone script to load the AP_Periph bootloader and my project target elf into memory. Once I was able to single step through the target it became clear I had two problems: (1.) global interrupt was disabled, so target interrupts were not firing. So I enabled them at the beginning of my target startup code. With that fixed I hit my next problem, (2.) CPU is left in privileged PSP stack mode by the bootloader (SPSEL bit set in CONTROL reg Documentation – Arm Developer), as Chibios uses a dual stack MSP / PSP scheme. So I was having stack corruption problems when interrupts fired.

I found this ARM post on bootloaders helpful Documentation – Arm Developer, which recommends activating MSP just before bootloader exit (ref. bullet point 7).

Once I made these two changes (modified AP_Periph bootloader to activate MSP before exit per https://github.com/geosmall/ardupilot/blob/757057fbad50b4a2b0e09819388d98283f9f7423/Tools/AP_Bootloader/bl_protocol.cpp#L266-L271, and enable interrupt in my target startup code), things proceeded to run as expected.

I would recommend modifying the AP_Periph bootloader code per above to avoid any unintended issues downstream. The bootloader presently works fine with AP targets as they also use Chibios and therefore activate PSP. I could take a shot at a pull request if this makes sense.

Thanks,
George

This i really and interesting topic to port the rangefinder on can node…

I’ve created a pull request to address the AP_Preiph bootloader issue here https://github.com/ArduPilot/ardupilot/pull/14022

I have just cloned master and tried to build f103-gps as example. Configure seemed to work fine but the build failed with:

Build failed
-> task in ‘’ failed (exit status 127):
{task 7696454249120: python3 ${SRCROOT}/modules/libcanard/dsdl_compiler/libcanard_dsdlc --header_only --outdir ${BUILDROOT}/modules/libcanard/dsdlc_generated ${SRCROOT}/modules/uavcan/dsdl/uavcan ${SRCROOT}/libraries/AP_UAVCAN/dsdl/ardupilot ${SRCROOT}/libraries/AP_UAVCAN/dsdl/com -> }
(run with -v to display more information)

Any idea what I could be doing wrong?

This issue was while using cygwin. I could build the copter firmware just fine, but for some reason not any of the AP_Periph boards firmware without getting the above fail message.
In the end I used Ubuntu to build f103-gps. Now to try it out!

For compile firmwares better use Ubuntu…

Hi everyone!
I have a new problem, I try to build my only RM3100 compass, and MS5525 Airspeed sensor, So I designed a new board with STM32F103 and STM32F412. Compass work fine, But when I test the MS5525, It’s not work, and I set the ARSP_TYPE right, I tried 3, 4, 5 for MS5525. Still not work, The MCU IIC works no problem, Send the right address for MS5525. I am confuse now … So I bought a new MS4525 set the ARSP_TYPE right. And It works…with the same setup on flight controller. I really don’t know why now …

What is you have more than one range finder? Or is only one supported?

Nevermind, I see its only 1

I got a couple F303 nodes and I have upgraded the firmware the the latest version and I have a couple questions…

The F303 nodes have 2 UART connections. Is it possible to use these are general purpose UARTs? For example could I connect a SIK radio to it? I also have a couple CUAV PW-link units (wifi) and they connect to a UART, can I use these?

Is it possible to define the protocols on the UARTs to Mavlink2, ESC telem, Frsky passthrough?

Could I connect an Oled display to the I2c ports?

I have not seen these topics asked before

Thanks

Good day, im trying use tf mini lidar on can node… after setting 0 as orientation, how must be set the rangefinder type in MP and on can node?

thanks you for your reply… these settings are also if you are using the rangefinder wired on serial… correct?

im testing the tf mini lidar on mro f103 can node.

my serial settins for make it work properly on the serial port is : serial baud 115200 and Serial protocol as 9 (lidar)
in rangefinder param ive set as rangefinder type 20…after this I’ve adjust the min and max distance as wiki by the manufacturer

You also set the correct orientation on the CAN side too right? like 25 for pointing down?

Did you plug into the serial port, or solder to the underside pads?

Good day, I’ve use the underside pads…