apache / apache/nuttx-apps

Compiling for the sim:nsh configuration fails

Open
#886 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
465
Forks
779
Avg merge
2d 9h
Merged PRs (30d)
36

Description

I followed the simple instructions for compiling the `sim:nsh` configuration (https://nuttx.apache.org/docs/latest/guides/simulator.html).
Near the end of the compilation, I get a compilation failure:

```
/home/koen/Documents/Projects/NuttX/sim/master/apps/nshlib/nsh_romfsetc.c:89: undefined reference to `romfs_img_len'
/usr/bin/ld: /home/koen/Documents/Projects/NuttX/sim/master/apps/nshlib/nsh_romfsetc.c:91: undefined reference to `romfs_img'
```

This is the piece of code where the references to `romfs_img_len` and `romfs_img` are made (`CONFIG_NSH_CROMFSETC` is not set in this configuration):

```
int nsh_romfsetc(void)
{
int ret;

#ifndef CONFIG_NSH_CROMFSETC
struct boardioc_romdisk_s desc;

/* Create a ROM disk for the /etc filesystem */

desc.minor = CONFIG_NSH_ROMFSDEVNO; /* Minor device number of the RAM disk. */
desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the RAM disk */
desc.sectsize = CONFIG_NSH_ROMFSSECTSIZE; /* The size of one sector in bytes */
desc.image = romfs_img; /* File system image */

ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc);
if (ret < 0)
{
ferr("ERROR: boardctl(BOARDIOC_ROMDISK) failed: %d\n", -ret);
return ERROR;
}
#endif
```

I got the code compiled by manually including the `nsh_romfsimg.h` header but that's not the proper solution of course.

The comments are confusing me as well. This is for a **ROM** disk, but the comments in the code speak of a **RAM** disk?

My feeling is that the `nsh_romfsimg.h` header should be included if `CONFIG_NSH_CROMFSETC` is not defined but I'm a complete newbie and I'm probably wrong in this (maybe the `sim:nsh` configuration itself is faulty?).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.