On 21/07/2023 16:33, Liviu Ionescu wrote:
On 21 Jul 2023, at 16:55, Tomas Vanek <tom_...@users.sourceforge.net> wrote:
You have to use "interface/stlink-dap.cfg" as I wrote, not
"interface/stlink.cfg"
oops!
It went a bit further, but it hang when trying to start the scheduler:
```
1: Test command: /Users/ilg/Work/xpack-dev-tools-build/openocd-0.12.0-2/darwin-x64/application/bin/openocd "-c" "gdb_port disabled" "-c" "tcl_port disabled" "-c" "telnet_port disabled" "-f" "interface/stlink-dap.cfg"
"-f" "target/stm32f7x.cfg" "-c" "program rtos-apis-test.elf verify" "-c" "arm semihosting enable" "-c" "arm semihosting_cmdline rtos-apis-test" "-c" "reset halt" "-c" "cortex_m maskisr
on" "-c" "resume"
1: Test timeout computed to be: 10000000
1: xPack Open On-Chip Debugger 0.12.0+dev-01276-g8e3e5b323-dirty
(2023-07-21-16:29)
1: Licensed under GNU GPL v2
1: For bug reports, read
1: http://openocd.org/doc/doxygen/bugs.html
1: Info : auto-selecting first available session transport "dapdirect_swd". To
override use 'transport select <transport>'.
1: Info : STLINK V2J42M27 (API v2) VID:PID 0483:3752
1: Info : Target voltage: 3.238973
1: Info : Unable to match requested speed 2000 kHz, using 1800 kHz
1: Info : Unable to match requested speed 2000 kHz, using 1800 kHz
1: Info : clock speed 1800 kHz
1: Info : stlink_dap_op_connect(connect)
1: Info : SWD DPIDR 0x5ba02477
1: Info : [stm32f7x.cpu] Cortex-M7 r1p0 processor detected
1: Info : [stm32f7x.cpu] target has 8 breakpoints, 4 watchpoints
1: Info : gdb port disabled
1: Info : Unable to match requested speed 2000 kHz, using 1800 kHz
1: Info : Unable to match requested speed 2000 kHz, using 1800 kHz
1: [stm32f7x.cpu] halted due to debug-request, current mode: Thread
1: xPSR: 0x01000000 pc: 0x080001f8 msp: 0x20080000
1: Info : Unable to match requested speed 8000 kHz, using 4000 kHz
1: Info : Unable to match requested speed 8000 kHz, using 4000 kHz
1: ** Programming Started **
1: Info : device id = 0x10016451
1: Info : flash size = 2048 KiB
1: Info : Single Bank 2048 kiB STM32F76x/77x found
1: ** Programming Finished **
1: ** Verify Started **
1: ** Verified OK **
1: semihosting is enabled
1: semihosting command line is [rtos-apis-test]
1: Info : Unable to match requested speed 2000 kHz, using 1800 kHz
1: Info : Unable to match requested speed 2000 kHz, using 1800 kHz
1: [stm32f7x.cpu] halted due to debug-request, current mode: Thread
1: xPSR: 0x01000000 pc: 0x080001f8 msp: 0x20080000, semihosting
1: cortex_m interrupt mask on
1: Info : tcl server disabled
1: Info : telnet server disabled
1:
1: Hardware initialised
1: Main stack 0x2007f400-0x20080000
1: os_startup_initialize_free_store(0x20003818,506856)
1: first_fit_top(0x20003818,506856) @0x20003070 app
1: out_of_memory_handler(0x8029749) @0x20003070 app
1: estd::pmr::set_default_resource(0x20003070)
1: rtos::memory::init_once_default_resource()
1: malloc_memory_resource() @0x20002ec4 malloc
1: first_fit_top(0x2007bc00,14336) @0x2007bbc0 sys
1: lifo(0x2007bc00,14336) @0x2007bbc0 sys
1: out_of_memory_handler(0x8029751) @0x2007bbc0 sys
1: rtos::memory::set_default_resource(0x2007bbc0)
1: block_pool_typed_inclusive() @0x2007b9e0 pool-th
1: out_of_memory_handler(0x8029751) @0x2007b9e0 pool-th
1: rtos::memory::set_resource_typed<os::rtos::thread>(0x2007b9e0)
1: block_pool_typed_inclusive() @0x2007b978 pool-cv
1: out_of_memory_handler(0x8029751) @0x2007b978 pool-cv
1: rtos::memory::set_resource_typed<os::rtos::condition_variable>(0x2007b978)
1: block_pool_typed_inclusive() @0x2007b8f0 pool-ef
1: out_of_memory_handler(0x8029751) @0x2007b8f0 pool-ef
1: rtos::memory::set_resource_typed<os::rtos::event_flags>(0x2007b8f0)
1: block_pool_typed_inclusive() @0x2007b810 pool-mp
1: out_of_memory_handler(0x8029751) @0x2007b810 pool-mp
1: rtos::memory::set_resource_typed<os::rtos::memory_pool>(0x2007b810)
1: block_pool_typed_inclusive() @0x2007b6f0 pool-mq
1: out_of_memory_handler(0x8029751) @0x2007b6f0 pool-mq
1: rtos::memory::set_resource_typed<os::rtos::message_queue>(0x2007b6f0)
1: block_pool_typed_inclusive() @0x2007b620 pool-mx
1: out_of_memory_handler(0x8029751) @0x2007b620 pool-mx
1: rtos::memory::set_resource_typed<os::rtos::mutex>(0x2007b620)
1: block_pool_typed_inclusive() @0x2007b590 pool-sp
1: out_of_memory_handler(0x8029751) @0x2007b590 pool-sp
1: rtos::memory::set_resource_typed<os::rtos::semaphore>(0x2007b590)
1: block_pool_typed_inclusive() @0x2007b4a0 pool-tm
1: out_of_memory_handler(0x8029751) @0x2007b4a0 pool-tm
1: rtos::memory::set_resource_typed<os::rtos::timer>(0x2007b4a0)
1: os_run_init_array()
1: Device '/dev/mc' linked
1: my_char_impl()=@0x20002c64 1
1: Device '/dev/mc2' linked
1: my_char_impl()=@0x20002c8c 2
1: Device '/dev/mb' linked
1: my_block_impl::my_block_impl()=@0x20002ce0
1: Device '/dev/mb-p1' linked
1: Device '/dev/mb-p2' linked
1: file_descriptors_manager::file_descriptors_manager(5)=0x20002da8
1: ::malloc(2528)=0x2007a088
1: Static objects constructed
1:
1: µOS++ IIIe version 7.0.0
1: Copyright (c) 2007-2023 Liviu Ionescu
1: Scheduler: µOS++ Cortex-M7 FP, preemptive, BASEPRI(4), WFI
1: System clock: 16000000 Hz
1: Scheduler frequency: 1000 ticks/sec
1: Default stack size: 2048 bytes
1: Interrupts stack size: 3072 bytes
1: Built with GCC 12.2.1 20221205, with exceptions
1:
1: scheduler::start()
```
Can you provide more details on what "cortex_m maskisr on" does? How long are
the interrupts masked?
Is it so difficult to search it in the manual? Or do you want a paid
support contract?
My test uses PendSV to switch between threads, and SysTick to keep track of
time. It is not sensitive to short moments when SysTick interrupts are missed,
but the scheduler does not work without PendSV.
I expected it first. But later comparisons of OpenOCD runs of my simple
test code with J-Link and ST-link GDB servers suggested that J-link and
ST-link GDB servers keep interrupts masked.
Your last test shows it's not as easy as that, they implement some
fiddling with C_MASKINTS. Perhaps they unmask interrupts only if the
core sleeps after WFI instruction.
Does this test code run under ST-link GDB server?
T