Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Dual NIOS exception overwrite

When I load the second NIOS code, it overwrites the exception handler in the first NIOS space.

I'm using a shared ddr_sdram, but neither core's linker maps overlap.

Exception addresses are 08000020 and 09000020 in the two cores.

I debug the first NIOS and halt at main().

The problem comes the moment I download the second core, before anything but crt0 and alt_main run (both cores halt at main()).

The overwrite data is

08000020: 00000000 00000000 FFFFFFFF FFFFFFFF

10.1 is unable to halt anywhere but main, so I wrote _start and alt_main to do exactly nothing. It seems merely downloading causes the overwrite. I confirmed the elf has nothing below 09000000 for the second code.

Help??

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I further confirmed that it is the download itself. I wrote the _start code for both processors to immediately loop forever. Again, nothing in the elf at that location.

    I think it is a 10.1 bug.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    well I don't think I'd be able to help, but if I were you I'd start looking to see what is causing the problem by:

    - Would the same address range be overwritten if there was only one processor in the system?

    - Is the address being overwritten in fact the same as the other Nios's ISR? I'd check this by changing the Nios's base address.

    - Would it matter that you load the Nios that has the higher address (09X...) first, then the other one?

    Cheers,

    Kaveh
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Fixed by writing my own bootloader that has one processor wait in flash until the other writes to a mailbox. Then the waiting processor continues with copying code from flash to ram.