renode / renode

Renode - Antmicro's open source simulation and virtual development framework for complex embedded systems
https://renode.io
Other
1.61k stars 287 forks source link

LoadBinary does not seem to work for STM32F746 #653

Open capablegh opened 2 months ago

capablegh commented 2 months ago

Description

"LoadBinary" does not for the STMF746 Discovery board. The error reported is

[ERROR] cpu: PC does not lay in memory or PC and SP are equal to zero. CPU was halted.

Expected behaviour

"LoadBinary" should work for STM32F7 as it does for nRF52840.

How to reproduce?

The script I am using is below

using sysbus
mach create "m0"

machine LoadPlatformDescription @platforms/boards/stm32f7_discovery-bb.repl
# sysbus LoadELF @zephyr-stm32f7_discovery-bb.elf
sysbus LoadBinary @zephyr-stm32f7_discovery-bb.bin 0

showAnalyzer usart1
start

A similar script for nrf52840dk works for LoadELF as well as LoadBinary is as below

using sysbus
mach create "m0"

machine LoadPlatformDescription @platforms/boards/nrf52840dk_nrf52840.repl

# sysbus LoadELF @zephyr-nrf9160dk_nrf52840.elf
sysbusLoadBinary @zephyr-nrf9160dk_nrf52840.bin 0

showAnalyzer uart0
start

Environment

Additional information

None

Do you plan to address this issue and file a PR?

No

WojMel commented 1 week ago

Hi @capablegh,

For LoadELF Renode can get the entry point from the ELF file itself, but it's not possible to get this information from a raw binary file.

To fix your script you can just set the PC to entry point manually by adding a cpu PC <entry point address> line.

PiotrZierhoffer commented 1 week ago

On Cortex-M you're typically better off setting cpu VectorTableOffset <vtor address> - it will automatically set both the PC and SP values

capablegh commented 1 week ago

Thanks for taking the time, and respond. Regards.

On Wed, Oct 23, 2024 at 8:25 PM Wojciech Meller @.***> wrote:

Hi @capablegh https://github.com/capablegh,

For LoadELF Renode can get the entry point from the ELF file itself, but it's not possible to get this information from a raw binary file.

To fix your script you can just set the PC to entry point manually by adding a cpu PC line.

— Reply to this email directly, view it on GitHub https://github.com/renode/renode/issues/653#issuecomment-2433867362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD52XBDSN47N4VVQBYFM2NLZ5A47BAVCNFSM6AAAAABMO7MEOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZTHA3DOMZWGI . You are receiving this because you were mentioned.Message ID: @.***>