Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Can't find room for painting the stack when stack isn't in RAM region #323

Open
jonathanpallant opened this issue May 23, 2022 · 1 comment
Assignees
Labels
difficulty: medium Somewhat difficult to solve status: needs design This feature needs design work to move forward topic: memory type: bug Something isn't working

Comments

@jonathanpallant
Copy link
Contributor

jonathanpallant commented May 23, 2022

Describe the bug

I fell over a bug in the stack painting stuff working on Neotron. I don't think probe-run can cope when the stack isn't in the RAM region. In my case I have a RAM region for .data/.bss, and two separate stacks, in regions called CORE0_STACK and CORE1_STACK. It tries to fit the painting code into RAM and gets sad when it doesn't fit, when CORE0_STACK is right there empty.

It's annoying because the failure mode isn't "I didn't paint your stack", it's "I exited and refused to take your chip out of reset".

To Reproduce
Steps to reproduce the behavior:

Make a project where stack isn't in the RAM region, but is in another region (like STACK). Set __stack_start = ORIGIN(STACK) + LEN(STACK) so cortex-m-rt does the right thing.

Expected and observed behavior

I expected probe-run to flash my chip and start my code.

What it actually says it that it couldn't find the space for the painting code, and exited.

config.toml

See https://github.com/Neotron-Compute/Neotron-Pico-BIOS/tree/12f735402400b421d4e0fb3a3bd717b34fe84a40, but you'll want to make the RAM region smaller to trigger the bug (it has a bunch of padding in it currently).

Probe details

It's an RP2040 with the DapperMime firmware.

Operating System:

Arch Linux.

ELF file (attachment)

Can attach later, or you can build it from above repo.

Additional context

N/A

@Urhengulas Urhengulas added type: bug Something isn't working difficulty: medium Somewhat difficult to solve status: needs design This feature needs design work to move forward labels May 31, 2022
@Urhengulas
Copy link
Member

#39 is related, as it is also concerned with multiple ram regions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty: medium Somewhat difficult to solve status: needs design This feature needs design work to move forward topic: memory type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants