pyocd / pyocd/pyOCD

Issue with b-l4s5i-iot01a stm proto brd with rw_iram1 outside segement with connecting with debugger

Open
#1,011 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
560
Avg merge
1h 41m
Merged PRs (30d)
3

Description

the b-l4s5i-iot0a1, when I try to connect and debug I get the rw_IRAM1 outside of segment. Then of course the gdbserver gets the exception individual must not cross memory region boundary. I seen this occurred before with other entries but I have not see a solution or a work around.
Note I have the latest version of studio and the the tools are up to date.

Any help cause we are developing a target brd with the stm32l4, it is important to get this going.

Thanks

warning: []
[2020-11-18T16:33:56.178] [INFO] root/mbs-debug - log: Loadable section “RW_IRAM1” outside of ELF segments
[]
[2020-11-18T16:33:56.255] [INFO] root/mbs-debug - stdout: done.
[]
[2020-11-18T16:33:56.288] [INFO] root/mbs-debug - stdout: 0001952:INFO:gdbserver:One client connected!
[]
[2020-11-18T16:33:56.325] [INFO] root/mbs-debug - log: warning: Loadable section “RW_IRAM1” outside of ELF segments
[]
[2020-11-18T16:33:56.326] [INFO] root/mbs-debug - log: warning: Overlapping regions in memory map: ignoring
[]
[2020-11-18T16:33:56.398] [INFO] root/mbs-debug - stdout: EvrRtxMutexError (mutex_id=, status=) at .\mbed-os\cmsis\device\rtos\source/mbed_rtx_handlers.c:141
[]
[2020-11-18T16:33:56.400] [INFO] root/mbs-debug - stdout: 141 }
[]
[2020-11-18T16:33:56.401] [INFO] root/mbs-debug - stdout: 0002015:INFO:gdbserver:Attempting to load Argon
0002016:INFO:gdbserver:Attempting to load FreeRTOS
[]
[2020-11-18T16:33:56.402] [INFO] root/mbs-debug - stdout: 0002016:INFO:gdbserver:Attempting to load Zephyr
[]
[2020-11-18T16:33:56.402] [INFO] root/mbs-debug - stdout: 0002017:INFO:gdbserver:Attempting to load RTX5
[]
[2020-11-18T16:33:56.403] [INFO] root/mbs-debug - stdout: 0002017:INFO:gdbserver:RTX5 loaded successfully
[]
[2020-11-18T16:33:56.403] [INFO] root/mbs-debug - console: Attached to debugger on port 50004 []
[2020-11-18T16:33:56.404] [DEBUG] MbedStudio - telemetry/progress [ { percent: 0, message: ‘Loading Image’ } ]
[2020-11-18T16:33:57.036] [DEBUG] MbedStudio - telemetry/progress [ { percent: 100, message: ‘Loading Image’ } ]
[2020-11-18T16:33:57.106] [INFO] root/mbs-debug - console: Image loaded: c:/Users/SSchatzkin/Mbed Programs/blinky_b-l4s5i/BUILD/B_L4S5I_IOT01A/ARMC6/blinky_b-l4s5i.elf []
[2020-11-18T16:33:57.415] [INFO] root/mbs-debug - stdout: 0002963:ERROR:gdbserver:Unhandled exception in handle_message: individual memory accesses must not cross memory region boundaries
Traceback (most recent call last):
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 383, in handle_message
reply = handler(msg[msgStart:])
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 610, in v_command
return self.v_cont(cmd)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 625, in v_cont
if self.is_threading_enabled():
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 1157, in is_threading_enabled
return (self.thread_provider is not None) and self.thread_provider.is_enabled
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\rtos\rtx5.py”, line 408, in is_enabled
return self.get_kernel_state() != 0 and not self._target.in_thread_mode_on_main_stack()
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\rtos\rtx5.py”, line 446, in get_kernel_state
return self._target_context.read8(self._os_rtx_info + RTX5ThreadProvider.KERNEL_STATE_OFFSET)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\memory_interface.py”, line 64, in read8
return self.read_memory(addr, 8, now)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\debug\cache.py”, line 33, in read_memory
return self._memcache.read_memory(addr, transfer_size, now)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 233, in read_memory
data = self.read_memory_block8(addr, 1)[0]
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 253, in read_memory_block8
if not self._check_regions(addr, size):
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 225, in _check_regions
raise MemoryAccessError(“individual memory accesses must not cross memory region boundaries”)
pyocd.cache.memory.MemoryAccessError: individual memory accesses must not cross memory region boundaries
[]
[2020-11-18T16:33:57.417] [INFO] root/mbs-debug - stderr: “0002963:ERROR:gdbserver:Unhandled exception in handle_message: individual memory accesses must not cross memory region boundaries”
[]
[2020-11-18T16:33:57.418] [INFO] root/mbs-debug - log: warning: Remote failure reply: E01
[]
[2020-11-18T16:33:57.420] [INFO] root/mbs-debug - stdout: 0002963:ERROR:gdbserver:Unhandled exception in handle_message: individual memory accesses must not cross memory region boundaries
Traceback (most recent call last):
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 383, in handle_message
reply = handler(msg[msgStart:])
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 610, in v_command
return self.v_cont(cmd)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 625, in v_cont
if self.is_threading_enabled():
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 1157, in is_threading_enabled
return (self.thread_provider is not None) and self.thread_provider.is_enabled
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\rtos\rtx5.py”, line 408, in is_enabled
return self.get_kernel_state() != 0 and not self._target.in_thread_mode_on_main_stack()
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\rtos\rtx5.py”, line 446, in get_kernel_state
return self._target_context.read8(self._os_rtx_info + RTX5ThreadProvider.KERNEL_STATE_OFFSET)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\memory_interface.py”, line 64, in read8
return self.read_memory(addr, 8, now)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\debug\cache.py”, line 33, in read_memory
return self._memcache.read_memory(addr, transfer_size, now)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 233, in read_memory
data = self.read_memory_block8(addr, 1)[0]
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 253, in read_memory_block8
if not self._check_regions(addr, size):
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 225, in _check_regions
raise MemoryAccessError(“individual memory accesses must not cross memory region boundaries”)
pyocd.cache.memory.MemoryAccessError: individual memory accesses must not cross memory region boundaries
0003044:ERROR:gdbserver:Unhandled exception in handle_message: individual memory accesses must not cross memory region boundaries
Traceback (most recent call last):
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 383, in handle_message
reply = handler(msg[msgStart:])
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 858, in handle_query
resp = self.handle_query_xml(b’threads’, int(data[0], 16), int(data[1].split(b’#’)[0], 16))
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 1047, in handle_query_xml
xml = self.get_threads_xml()
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 1137, in get_threads_xml
if not self.is_threading_enabled():
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py”, line 1157, in is_threading_enabled
return (self.thread_provider is not None) and self.thread_provider.is_enabled
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\rtos\rtx5.py”, line 408, in is_enabled
return self.get_kernel_state() != 0 and not self._target.in_thread_mode_on_main_stack()
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\rtos\rtx5.py”, line 446, in get_kernel_state
return self._target_context.read8(self._os_rtx_info + RTX5ThreadProvider.KERNEL_STATE_OFFSET)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\memory_interface.py”, line 64, in read8
return self.read_memory(addr, 8, now)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\debug\cache.py”, line 33, in read_memory
return self._memcache.read_memory(addr, transfer_size, now)
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 233, in read_memory
data = self.read_memory_block8(addr, 1)[0]
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 253, in read_memory_block8
if not self._check_regions(addr, size):
File “c:\Users\SSchatzkin\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\cache\memory.py”, line 225, in _check_regions
raise MemoryAccessError(“individual memory accesses must not cross memory region boundaries”)
pyocd.cache.memory.MemoryAccessError: individual memory accesses must not cross memory region boundaries
[]
[2020-11-18T16:33:57.421] [INFO] root/mbs-debug - stderr: “0002963:ERROR:gdbserver:Unhandled exception in handle_message: individual memory accesses must not cross memory region boundaries”
[]
[2020-11-18T16:33:57.421] [INFO] root/mbs-debug - stdout:
Program []
[2020-11-18T16:33:57.422] [INFO] root/mbs-debug - stdout: stopped.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the B_L4S5I_IOT01A ELF and debugger setup described in the report. Start with pyocd/rtos/rtx5.py and follow the read8 call through pyocd/cache/memory.py and pyocd/gdbserver/gdbserver.py. Done means the image loads and the debugger can continue without the memory-region exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.