px4 / nuttx Goto Github PK
View Code? Open in Web Editor NEWStandard NuttX with current PX4 patches
Home Page: https://github.com/apache/incubator-nuttx
License: Apache License 2.0
Standard NuttX with current PX4 patches
Home Page: https://github.com/apache/incubator-nuttx
License: Apache License 2.0
On MacOS, with environment variable CLICOLOR_FORCE=1
set in .bashrc
, the NuttX compilation fails at several places where it parses ls
to find lists of kconfig files. Terminal color codes get spliced into the master kconfig list, which then fails to parse correctly.
For my color configuration, it failed only for files that were incorrectly marked executable. Although these permissions appear to have been fixed in the upstream NuttX, other users might run into this issue on all files, depending on their color configuration.
My immediate solution was to move CLICOLOR_FORCE to .bash_profile
where it belongs (or disable it altogether). However, it may take users a very long time to discover this problem.
Another solution:
At the top of platforms/nuttx/NuttX/apps/tools/mkkconfig.sh
, add unset CLICOLOR_FORCE
.
I expect this change may be too specific to be accepted, but at least this will document the issue for future users.
Here's the error message:
.../Firmware/build/px4_fmu-v5_<model>/NuttX/apps/examples/Kconfig:57: '.../Firmware/build/px4_fmu-v5_<model>/NuttX/apps/examples/lis3dsh_reader/Kconfig' not found (in 'source ".../Firmware/build/px4_fmu-v5_<model>/NuttX/apps/examples/lis3dsh_reader/Kconfig"').
Check that environment variables are set correctly (e.g. $srctree, which is unset or blank). Also note that unset environment variables expand to the empty string.
I added mavlink message, that checks the SD card status periodically (in contrast to current implementation STORAGE_INFORMATION, that need to be asked by the ground).
during checking my message, I tested what will happen if I remove the SD card during operation. doing that caused the mavlink thread to stop.
first, do you consider that as a problem? how the system behave if SD is removed, or get malfunction during flight.
I only checked that above scenario, (added periodic check mavlink message). but i guess that other methods that required the SD are much more critical, for example reading mission on commander....
I think that it related to the fact that reading the status of fat32 is done by fat_statfs(), that waits for semaphore fat_semtake(fs);
Testing code can be found at:
https://github.com/BazookaJoe1900/Firmware/tree/testing-sd_removal
(is that the right place to point to that issue?)
This line does some problems while using make px4_fmu-v4 qconfig
while saving defconfig.
NuttX/arch/arm/src/imxrt/Kconfig
Line 967 in d509b1e
LN: platform/board to /home/igor/GIT/PX4/Firmware/build/px4_fmu-v4/NuttX/apps/platform/dummy
arch/arm/src/imxrt/Kconfig:968: syntax error
arch/arm/src/imxrt/Kconfig:967: invalid option
tools/Makefile.unix:595: recipe for target 'savedefconfig' failed
If not, is there another library that provides similar functionality?
When compiling the code on a machine which has unsigned long defined as 8 bytes, the buggy code here will mark the second branch as duplicate branch since on x86-64 bit machines, unsigned long and unsigned long long have the same size, ie, 8 bytes.
case sizeof(unsigned long):
c = 'l';
break;
#if defined(CONFIG_HAVE_LONG_LONG) && ULLONG_MAX != ULONG_MAX
case sizeof(unsigned long long):
c = 'l';
flags |= FL_LONG;
flags &= ~FL_SHORT;
break;
#endif
A relatively simple fix would be to have the case for unsigned long in the #else
branch of the #if
.
#if defined(CONFIG_HAVE_LONG_LONG) && ULLONG_MAX != ULONG_MAX
case sizeof(unsigned long long):
c = 'l';
flags |= FL_LONG;
flags &= ~FL_SHORT;
break;
#else
case sizeof(unsigned long):
c = 'l';
break;
#endif
This should fix the issue of duplicate branch.
at fs_fat32.c fat_seek 1239 line:
/* Then get the current sector from the cluster and the offset
* into the cluster from the position
*/
(void)fat_currentsector(fs, ff, filep->f_pos);
in fact fat_currentsector will change the currentsector to the sector we seek
int fat_currentsector(struct fat_mountpt_s *fs, struct fat_file_s *ff,
off_t position)
{
int sectoroffset;
if (position <= ff->ff_size)
{
/* sectoroffset is the sector number offset into the current cluster */
sectoroffset = SEC_NSECTORS(fs, position) & CLUS_NDXMASK(fs);
/* The current cluster is the first sector of the cluster plus
* the sector offset
*/
ff->ff_currentsector = fat_cluster2sector(fs, ff->ff_currentcluster)
+ sectoroffset;
/* The remainder is the number of sectors left in the cluster to be
* read/written
*/
ff->ff_sectorsincluster = fs->fs_fatsecperclus - sectoroffset;
finfo("position=%d currentsector=%d sectorsincluster=%d\n",
position, ff->ff_currentsector, ff->ff_sectorsincluster);
return OK;
}
/* The position does not lie within the file */
return -ENOSPC;
}
you could see the code, only when position <= ff->ff_size ,the sector will be changed right.
if position > filesize,it will return err,but dont deal with it.
if i want to write a file(size 1000) at 1500, first you seek to 1500,the seek func won change the current_sector,the current_sector will restain the last time.Then you use write,just write to the last sector not the sector 1500 bytes should be.This make the random seek and write not work and make a mess.
The solve :
int sectoroffset;
/* sectoroffset is the sector number offset into the current cluster */
sectoroffset = SEC_NSECTORS(fs, filep->f_pos) & CLUS_NDXMASK(fs);
/* The current cluster is the first sector of the cluster plus
* the sector offset
*/
ff->ff_currentsector = fat_cluster2sector(fs, ff->ff_currentcluster)
+ sectoroffset;
/* The remainder is the number of sectors left in the cluster to be
* read/written
*/
ff->ff_sectorsincluster = fs->fs_fatsecperclus - sectoroffset;
use the code replace the func fat_currentsector in seek func.
in other situation the fat_currentsector maybe work right
Hi all! So, I was trying to use as GPIO the pins that are right now for OTGFS
(PA11 and PA12, namely), in a fmu-v5
target. For that, I first wanted to disable OTGFS, since that interface is taking those pins and configuring them. However, when I disable OTGFS
, I get this linking problem:
Is it a bug or I am missing something in the configuration?
Hi,
I am following tutorial https://www.youtube.com/watch?v=2Bvku3dnrr8 .
On the 13:22 minute, It can be seen the commands needed for installation and configuration of Nuttx for a board - which are " ./tools/configure.sh -c nucleo-l476rg/nsh"
I would like to use the board for px4 CUAV V5+ that has processor: STM32F765 -------------/https://docs.px4.io/main/en/flight_controller/cuav_v5_plus.html --------------
I have changed the board location to: stm32f769i-disco/nsh ,but this gives out the errors below:
tools/configure.bat -c stm32f769i-disco/nsh
mingw32-gcc.exe -Wall -Wstrict-prototypes -Wshadow -g -pipe -I. -DCONFIG_WINDOWS_NATIVE=y -o configure.exe configure.c cfgparser.c
ERROR: stat of (null) failed: Invalid argument
configure.exe failed
I also tried with:
tools/configure.sh -c stm32f769i-disco/nsh
and get the following error:
tools/configure.sh: line 142: [: /home/User: binary operator expected
tools/configure.sh: line 161: [: /home/User: binary operator expected
tools/configure.sh: line 181: [: /home/User: binary operator expected
tools/configure.sh: line 186: [: /home/User: binary operator expected
grep: /home/User: No such file or directory
grep: UserSurname/nuttx/tools/../boards///stm32f769i-disco/configs/nsh/defconfig: No such file or directory
grep: /home/User: No such file or directory
grep: UserSurname/nuttx/tools/../boards///stm32f769i-disco/configs/nsh/defconfig: No such file or directory
Copy files
ln: target UserSirname/nuttx/tools/../Make.defs': No such file or directory
Failed to symlink /home/UserSurname/nuttx/tools/../boards///stm32f769i-disco/configs/nsh/Make.defs
I can`t figure out what I'm doing wrong.
Any advice is appreciated.
Thanks
Thinking about this again we probably need the branch naming to be consistent such that the nuttx (and apps) branch stays in tact once PX4 master merges to beta, then stable.
Two compilation error:
Line 960 fs/procfs/fs_procfsproc.c
linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%3-s %-2s %-3s %s\n", "SD", "RF", "TYP", "FLAGS");
unknown conversion type character
probably need to be changed to
linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-2s %-3s %s\n", "SD", "RF", "TYP", "FLAGS");
Line 983 fs/procfs/fs_procfsproc.c
linesize = snprintf(procfile->line, STATUS_LINELEN, "%3d %2d %3d %02x",
i + CONFIG_NFILE_DESCRIPTORS,
(long)socket->s_crefs, socket->s_type, socket->s_flags)
probably need to be changed to
linesize = snprintf(procfile->line, STATUS_LINELEN, "%3d %2d %3d %02x",
i + CONFIG_NFILE_DESCRIPTORS,
socket->s_crefs, socket->s_type, socket->s_flags)
elf_init open a elf file , if both enabled CONFIG_NSH_BUIlTAPPS and CONFIG_NSH_FILE_APPS , elf_init will read elf file in /bin directory, but that length is zero , elf_read failed return and NOT close elf fd, so this line MUST be return to errout_with_init
Line 238 in feb5b6f
I'm trying to compile the px4 firmware for the px4_fmu-v5_default target with uClibc++ as C++ library. However, I get several undefined references in the linking phase (ld command):
Am I missing something in the configuration?
Line 141
ifeq (
CHIP_CSRCS += stm32_lsi.c
endif
stm32_lsi.c will NOT be compiled if both CONFIG_STM32F7_IWDG and CONFIG_STM32F7_RTC_LSICLOCK equals to y
Could you please check it?
Thanks
GPIO_OTGFS_ID pin was configured without any predefinition in OTG driver, but GPIO_USART1_RX_1 use the same pin was configured in low level startup before OTG driver initialization, so usart rx not work after OTG driver initialization
This is a dronecan application firmware that is hard faulting after the bootloader updates firmware (there is nothing occupying flash space after the bootloader). The near exact board config worked with an stm32f103zet6 prototype (only differences is that there is no fsmc, and only 1 memory region on the ret6) and I was able to get the dronecan node operational and a nuttx console going.
The board config can be found here: PX4/PX4-Autopilot@main...dirksavage88:Firmware:aa_cannode_v1
Dronecan bootloader works as intended and I see it come up in init mode, it allows me to update the firmware via the dronecan gui tool. I also verify node status and node info when I plug in the node flashed with the bootloader. With the hardfault, it doesn't recover and the bootloader doesn't jump into firmware enough for me to get a system console (it just restarts and the node comes back up in init).
See screen snips. I am reading the hardfault in the bus monitor ascii section.
@davids5 I believe this is similar to oliminexino stm32 you brought into Nuttx, it's just a higher density version (512kb flash, 64kb sram).
Other known issues: the nuttx hardware pinmap for the stm32f103r is missing uart4 & uart5. I've made these changes in my local nuttx submodule but it is not fixed upstream. The node has a sensor on uart4.
Use case:
open a file with readonly,then lseek to the end with offset 0
there will return a error( ENOSPC 28 "No space left on device")
so i can't get the file size with this.
TestFile:13,107,200 Byte
Code:
static off_t fat_seek(FAR struct file filep, off_t offset, int whence)
---------1164
if ((ff->ff_oflags & O_WROK) != 0)
{
/ Extend the cluster chain (fat_extendchain
* will follow the existing chain or add new
* clusters as needed.
*/
cluster = fat_extendchain(fs, cluster);
}
else
{
/* Otherwise we can only follow the existing chain */
cluster = fat_getcluster(fs, cluster);
}
---------1178
when i debug i found that fat_getcluster(fs, cluster) will retrun the "0x0fffffff" that means FAT cluster end.
but in fat_seek ,there is no end deal,so there will be a error.
The break way is less than clustersize,in the loop, position Just coincidentally equal to clustersize,so it continue find next cluster chan.
---------1142
if (position < clustersize)
{
break;
}
---------1145
Solution:
add FAT end deal or make break condition wiht "position <= clustersize"
Tests lists and makefile: https://bitbucket.org/david_s5/nuttx-knot/src (move to https://github.com/PX4-NuttX/nuttx-build-testing)
Setup on semaphoreci or travis-ci:
https://semaphoreci.com/nuttx/nuttx-knot/branches/master/builds/31
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.