NuttX
NuttX copied to clipboard
BACKPORT fs/cromfs: Fix a hardFault caused by unaligned memory access
Summary
This is a backport of apache/incubator-nuttx/#6347 and apache/incubator-nuttx/#6350. These two fixes solve a hardFault bug in cromfs.
Impact
The fix lets the compiler know that the nodes in nsh_romfsimg might not be word aligned. The rest is taken care off by compiler.
Testing
This fix is tested with current PX4-Autopilot master branch.
Please add [BACKPORT] to the commit message (see all the commits in the repo for format) - then force push
Please add [BACKPORT] to the commit message (see all the commits in the repo for format) - then force push
@davids5 Done.
@vxj9800 will this also solve the QGC connection issue.
@vxj9800 will this also solve the QGC connection issue.
@say-paul I tested it and it connects to QGC. But, for some reason it doesn't like the telemetry on UART0 connection. So, use CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1"
in default.px4board file for now. Also, in my quick test, the updated parameters didn't get saved on a restart. I'm not sure what the problem is right now.
I tried with :
$ ./tools/configure.sh raspberrypi-pico:nsh
$ make V=1
but it errors out with code 2, Not sure if I am missing anything. error log
echo "Create .version"
Create .version
tools/version.sh .version
chmod 755 .version
echo "Create version.h"
Create version.h
tools/mkversion /Users/saypaul/git_test/NuttX > include/nuttx/version.h.tmp
if [ -f include/nuttx/version.h ]; then if cmp include/nuttx/version.h.tmp include/nuttx/version.h; then rm -f include/nuttx/version.h.tmp; else mv include/nuttx/version.h.tmp include/nuttx/version.h; fi else mv include/nuttx/version.h.tmp include/nuttx/version.h; fi
/Library/Developer/CommandLineTools/usr/bin/make -C libs/libxx dirlinks
make[1]: Nothing to be done for `dirlinks'.
/Library/Developer/CommandLineTools/usr/bin/make -C boards dirlinks
make[1]: Nothing to be done for `dirlinks'.
/Library/Developer/CommandLineTools/usr/bin/make -C openamp dirlinks
make[1]: Nothing to be done for `dirlinks'.
/Library/Developer/CommandLineTools/usr/bin/make -C "" dirlinks
make: the `-C' option requires a non-empty string argument
Usage: make [options] [target] ...
@say-paul You will have to use this with PX4. First clone the PX4-Autopilot. Then open the files PX4-Autopilot/platforms/nuttx/NuttX/nuttx/fs/cromfs/cromfs.h
and PX4-Autopilot/platforms/nuttx/NuttX/nuttx/tools/gencromfs.c
and replicate the changes visible in the two commits above. Then build PX4 with make raspberrypi_pico_default
. Convert the generated elf to uf2 and upload it to the board. Let me know if this process doesn't work.
@vxj9800 I follow the above steps but it has the same effect as when I put "CONFIG_FS_CROMFS=n" (another solution you told before). In QGC , it shows rtk only and when I connect with "picocom -b 115200 /dev/ttyACM1" it shows "nsh>" in the terminal but it does not behave properly. "nsh>" move horizontally every time when I press "enter"
Not applicable to current PX4 nuttx version. PX4 upgraded to NuttX 10.3+