* Information on how to flash NuttX firmware to STM32F3 target was missing
in the documentation and asked by new users on the dev@ list.
* Example on how to Flash, Reset, Debug with OpenOCD is now added to docs.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
with other functionalities removed.
reason:
by doing this we can reduce context switch time,
When we exit from an interrupt handler, we directly use tcb->xcp.regs
before
text data bss dec hex filename
178368 876 130604 309848 4ba58 nuttx
after
text data bss dec hex filename
178120 876 130212 309208 4b7d8 nuttx
szie change -248
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
1.call_data->refcount is not remote_cpus;
2.nxsched_smp_call_add enqueue the call_data;
3.maybe nxsched_smp_call_handler is just doing;
4.dequeue the call_data but call_data->refcount is not corret;
5.unpredictability case will occur;
ap> cat pm
=================================================================
==30235==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf436edd9 at pc 0x03338a48 bp 0x9d1b6ca8 sp 0x9d1b6c98
READ of size 1 at 0xf436edd9 thread T0
#0 0x3338a47 in strncmp string/lib_strncmp.c:42
#1 0x371af87 in pm_get_file_index power/pm/pm_procfs.c:174
#2 0x371b066 in pm_open power/pm/pm_procfs.c:207
#3 0x3640d20 in procfs_open procfs/fs_procfs.c:419
#4 0x359bce2 in file_vopen vfs/fs_open.c:240
#5 0x359c431 in nx_vopen vfs/fs_open.c:312
#6 0x359cb53 in open vfs/fs_open.c:465
#7 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140
#8 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556
#9 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164
#10 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845
#11 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744
#12 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828
#13 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245
#14 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75
#15 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74
#16 0x332b6e6 in nxtask_startup sched/task_startup.c:70
#17 0x323ec3f in nxtask_start task/task_start.c:134
#18 0x33636ea in pre_start sim/sim_initialstate.c:52
ap> cat net
=================================================================
==30303==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4479a5a at pc 0x03338a48 bp 0x9d2b6ce8 sp 0x9d2b6cd8
READ of size 1 at 0xf4479a5a thread T0
#0 0x3338a47 in strncmp string/lib_strncmp.c:42
#1 0x5395d62 in netprocfs_open procfs/net_procfs.c:215
#2 0x3640d20 in procfs_open procfs/fs_procfs.c:419
#3 0x359bce2 in file_vopen vfs/fs_open.c:240
#4 0x359c431 in nx_vopen vfs/fs_open.c:312
#5 0x359cb53 in open vfs/fs_open.c:465
#6 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140
#7 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556
#8 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164
#9 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845
#10 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744
#11 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828
#12 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245
#13 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75
#14 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74
#15 0x332b6e6 in nxtask_startup sched/task_startup.c:70
#16 0x323ec3f in nxtask_start task/task_start.c:134
#17 0x33636ea in pre_start sim/sim_initialstate.c:52
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
CXX: libcxxmini/libxx_new.cxx "/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
use of the "register" storage class specifier is not allowed
register uint32_t sp;
^
"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
use of the "register" storage class specifier is not allowed
register uint32_t sp;
^
"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
use of the "register" storage class specifier is not allowed
register uint32_t sp;
^
make[1]: *** [Makefile:69: libxx_delete_sized.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:69: libxx_deletea_sized.o] Error 1
make[1]: *** [Makefile:69: libxx_new.o] Error 1
"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
use of the "register" storage class specifier is not allowed
register uint32_t sp;
^
"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
use of the "register" storage class specifier is not allowed
register uint32_t sp;
^
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit fixes the regression from https://github.com/apache/nuttx/pull/13561
In order to determine whether a context switch has occurred,
we can use g_running_task to store the current regs.
This allows us to compare the current register state with the previously
stored state to identify if a context switch has taken place.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
pci/pci.c:1128:15: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
1128 | pciinfo("Limit MME to %x, num to %d\n", mmc, num);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~
| |
| uint32_t {aka long unsigned int}
pci/pci.c:1128:30: note: format string is defined here
1128 | pciinfo("Limit MME to %x, num to %d\n", mmc, num);
| ~^
| |
| unsigned int
| %lx
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
pci/pci_qemu_test.c:218:6: warning: ‘ops’ may be used uninitialized [-Wmaybe-uninitialized]
218 | ops->write(dev->bus, &hdr->test, num, sizeof(num));
| ~~~^~~~~~~
pci/pci_qemu_test.c: In function ‘pci_qemu_test_probe’:
pci/pci_qemu_test.c:286:41: note: ‘ops’ was declared here
286 | FAR const struct pci_qemu_test_ops_s *ops;
|
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
415 | FAR struct pci_resource_s *res;
| ^~~
pci/pci.c: In function ‘pci_scan_bus’:
pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable]
663 | FAR struct pci_controller_s *ctrl = bus->ctrl;
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
The reason is that libc.h needs to check whether CONFIG is enabled before the corresponding macro is enabled
Error scene:
arm-none-eabi-ld: /home/crafcat7/SSD/xxx/xxx-dev/nuttx/staging/libc.a(arch_libc.o): in function `memmove':
/home/crafcat7/SSD/xxx/xxx-dev/nuttx/libs/libc/machine/arch_libc.c:146: multiple definition of `memmove'; /home/crafcat7/SSD/xxx/xxx-dev/nuttx/staging/libc.a(arch_memmove.o):/home/crafcat7/SSD/xxx/xxx-dev/nuttx/libs/libc/machine/arm/armv8-m/gnu/arch_memmove.S:56: first defined here
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
The FIOC_FILEPATH ioctl call is required if smartfs is to be used
together with inotify monitoring system. This implements the
call support to smartfs file system. The path to the file has to
be stored in smartfs_ofile_s structure during file open (and is freed
during close) as smartfs currently is not able to obtain the path
knowing only the file node. The full path is concatenated with the file
name and creates the full path needed for inotify to detect whether
the file is on the watchlist.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
We need to record the parent's integer register context upon exception
entry to a separate non-volatile area. Why?
Because xcp.regs can move due to a context switch within the fork() system
call, be it either via interrupt or a synchronization point.
Fix this by adding a "sregs" area where the saved user context is placed.
The critical section within fork() is also unnecessary.
There was an error in the fork() routine when system calls are in use:
the child context is saved on the child's user stack, which is incorrect,
the context must be saved on the kernel stack instead.
The result is a full system crash if (when) the child executes on a
different CPU which does not have the same MMU mappings active.