`posix_spawn` depends on these configurations:
- !BINFMT_DISABLE
- !DISABLE_MOUNTPOINT
- BOARDCTL
- BOARDCTL_APP_SYMTAB
- ELF
- FS_ROMFS
Check them in compile time may waste some time if the dependencies are not met,
move them to Kconfig to avoid this.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
libuv:
CC: pthread/pthread_mutexattr_setrobust.c libuv/src/unix/thread.c: In function ‘uv_thread_create_ex’:
libuv/src/unix/thread.c:174:24: error: storage size of ‘param’ isn’t known
174 | struct sched_param param;
| ^~~~~
btsak_main:
In file included from btsak_main.c:39:
btsak.h:149:1: error: unknown type name ‘bool’
149 | bool btsak_str2bool(FAR const char *str);
pipe_main.c:
CC: sim/sim_registerdump.c pipe_main.c:44:30: error: unknown type name ‘pthread_addr_t’
44 | static void *open_write_only(pthread_addr_t pvarg)
| ^~~~~~~~~~~~~~
pipe_main.c: In function ‘pipe_main’:
pipe_main.c:81:3: error: unknown type name ‘pthread_t’
81 | pthread_t writeonly;
redirect_test.c: In function ‘redirection_test’:
redirect_test.c:205:3: error: unknown type name ‘pthread_t’
205 | pthread_t readerid;
| ^~~~~~~~~
redirect_test.c:206:3: error: unknown type name ‘pthread_t’
206 | pthread_t writerid;
| ^~~~~~~~~
drivertest_posix_timer.c:48:29: error: ‘optarg’ undeclared (first use in this function)
48 | value = (type)strtoul(optarg, &ptr, base); \
drivertest_posix_timer.c:208:3: warning: implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration]
208 | sleep(SLEEPSECONDS);
| ^~~~~
drivertest_uart.c:92:13: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
92 | len = read(fd, &tmp_char, 1);
| ^~~~
| fread
drivertest_uart.c:323:44: error: ‘optopt’ undeclared (first use in this function)
323 | printf("Unknown option: %c\n", optopt);
kernel/fs/cases/fs_getfilep_test.c:71:9: warning: implicit declaration of function ‘fs_getfilep’ [-Wimplicit-function-declaration]
71 | ret = fs_getfilep(fileno(fp), &filep);
| ^~~~~~~~~~~
kernel/mm/cases/mm_test_008.c:148:9: warning: implicit declaration of function ‘task_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
148 | pid = task_create("TestNuttx08_routine_1",
| ^~~~~~~~~~~
| timer_create
/home/ajh/work/nuttxwork/apps/testing/cmocka/cmocka_main.c:171:11: warning: implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
171 | setenv("CMOCKA_XML_FILE", xml_path, 1);
| ^~~~~~
drivertest_pm_runtime.c:123:7: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
123 | usleep(210 * 1000);
| ^~~~~~
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
write returns in case some bytes were written but not everything can
fit.
This wasn't the case in NuttX but commit
d0680fd1bc51b7ead0b068fb24a31a144d22dc6c introduced this standard
behavior.
Summary
---------------------------------------------------------------------------------------------------------
Created a minimal demo application for Bluetooth. It works by displaying some data over Bluetooth and the
user can connect to the device running it on NuttX and read this data.
This can work in 2 scenarios: a real scenario, in which data from the BME680 (temperature, humidity, etc..)
is used and the user will be able to read it. The second scenario involves displaying some dummy data
(hardcoded values) for testing purposes.
This application can serve as an example for users implementing more complex applications using Bluetooth on NuttX.
Testing
---------------------------------------------------------------------------------------------------------
I used the ESP32-Sparrow (which includes the BME680 sensor) and the ESP32-devkitc boards for testing.
The Bluetooth stack starts by default with advertising when it initializes, however I noticed that enabling
advertising in the stack does not work (at least on ESP32). However, when scanning is also enabled, the
device starts advertising. Therefore, in our application, during the BLE services initialization part, I also
enable scanning as a temporary workaround in order to make sure the device advertises and the user can see it
and connect to it.
the current usage description is incorrect,
ifname must follow ethercat. The number of transfers can be specified
only after ifname is specified.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Memory leak can be detected when simply change the while(1) loop to exit. The lv_nuttx_deinit will free resources including display, input etc.
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This application continuously reads the file system of the spislv. Each received message will be written to the user in hexadecimal form, and the same received data will be sent back. In this way, the user can test if their spislv driver and hardware setup are working properly before proceeding further.
On a master device, using the SPI tool, when sending the message: spi exch -x 4 deadbeef
The slave device will output:
Slave: 4 Bytes read
Value in hex form from /dev/spislv2: de ad be ef
Slave: Writing value back to /dev/spislv2
If the controller frequency is high, system timer interrupts will
eventually interrupt the controller function, thereby increasing the
execution time. This may lead to skipping the control cycle, which
negatively affects the control algorithm.
With this option enabled, interrupts are disabled for the duration
of the controller function execution.
Here example results from CONFIG_EXAMPLES_FOC_PERF output
for b-g431b-esc1 board with CONFIG_EXAMPLES_FOC_NOTIFIER_FREQ=10000:
1. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=n
exec ticks=5258
nsec=30929
per ticks=21268
nsec=125105
2. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=y
exec ticks=3428
nsec=20164
per ticks=19203
nsec=112958
The difference is ~12us!
CONFIG_EXAMPLES_FOC_RUN_DISABLE option is used for tests and benchmarks, so we don't
care about wrong results for motor identification and sensor alignment routines
fix compilatgion error:
foc_motor_f32.c: In function 'foc_motor_init':
foc_motor_f32.c:1574:7: error: label 'errout' used but not defined
1574 | goto errout;
fix snprintf warning:
foc_thr.c:110:39: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=]
110 | snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
| ^~
foc_thr.c:110:36: note: directive argument in the range [-2147483648, 0]
110 | snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
| ^~~~~~
foc_thr.c:110:3: note: 'snprintf' output between 5 and 15 bytes into a destination of size 10
110 | snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vendor may add extended sentence may not handled in switch, error if -Werror=switch enabled.
And extended sentence should not added to general examples.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>