Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

General • printf ending up in decl_isr_bkpt isr_hardfault

$
0
0
Hi all,

Running on a pico 2.

I have some code that declares a global variable thus :

Code:

volatile uint8_t    Memory[MEMORY_SIZE];  __attribute__((aligned(MEMORY_SIZE))); // Main memory, one big block for convenience of DMA
MEMORY_SIZE is defined as 65536 (indirectly by a bit of maths). I need this to be aligned as I'm passing it in X to a state machine that will write to it by chained DMA.

To check this further down my program I have (after initializing the serial connection and stdio_init_all()) :

Code:

    printf("Address of Memory[0]=%x\n",(uintptr_t)Memory);
But this seems to more often than not crash out ending up in decl_isr_bkpt isr_hardfault.

Note the DMA and pio state machines are currently commented out and not initialized, the code is however running from RAM, but there should be enough as there's 500k+ on the pico 2 The uf2 for my code is only approx 60K, so should all fit.

Any idea what might be the problem?

Cheers.

Phill.

Statistics: Posted by PhillHS — Sun Feb 01, 2026 10:05 pm



Viewing all articles
Browse latest Browse all 8015

Trending Articles