UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar mrbietola
Scholar
1,055 Views
Registered: ‎05-31-2012

Is it possible to do a bootloader with interrupts?

Jump to solution

Hi, i would like to implement a bootloader for SPI that is also able to write data to flash.

I started with the numonix quad spi example that uses interrupts and all is fine, i can read and write flash.

Now the bootloader part. I used as example the SREC SPI bootloader but instead of the serial library, i'm using the code from the numonix quad spi example. I think i have a problem of overwriting something because after 5 reads my program reset from 0

If i comment the line as below, the program continue to run, so i think maybe i'm overwriting something related with interrupt 

 

static uint8_t load_exec ()
{
    uint8_t ret;
    void (*laddr)();
    int8_t done = 0;
    
    srinfo.sr_data = sr_data_buf;
    
    while (!done) {
        if ((ret = flash_get_srec_line (sr_buf)) != 0) 
            return ret;

        if ((ret = decode_srec_line (sr_buf, &srinfo)) != 0)
            return ret;
        
#ifdef VERBOSE
        display_progress (srec_line);
#endif
        switch (srinfo.type) {
            case SREC_TYPE_0:
                break;
            case SREC_TYPE_1:
            case SREC_TYPE_2:
            case SREC_TYPE_3:
  //              memcpy ((void*)srinfo.addr, (void*)srinfo.sr_data, srinfo.dlen);
                break;
            case SREC_TYPE_5:
                break;
            case SREC_TYPE_7:
            case SREC_TYPE_8:
            case SREC_TYPE_9:
                laddr = (void (*)())srinfo.addr;
                done = 1;
                ret = 0;
                break;
        }
    }

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar mrbietola
Scholar
1,569 Views
Registered: ‎05-31-2012

Re: Is it possible to do a bootloader with interrupts?

Jump to solution

Hi Herbert,

yes i think that the bootloader overwrite everything in the .vector section and if you use interrupts in your bootloader program you can't use them anymore.

Anyway i changed the code to work in polling and now it works

View solution in original post

0 Kudos
2 Replies
Voyager
Voyager
1,031 Views
Registered: ‎06-24-2013

Re: Is it possible to do a bootloader with interrupts?

Jump to solution

Hey @mrbietola,

 

maybe i'm overwriting something related with interrupt 

So where are you writing to? Maybe the interrupt table?

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Highlighted
Scholar mrbietola
Scholar
1,570 Views
Registered: ‎05-31-2012

Re: Is it possible to do a bootloader with interrupts?

Jump to solution

Hi Herbert,

yes i think that the bootloader overwrite everything in the .vector section and if you use interrupts in your bootloader program you can't use them anymore.

Anyway i changed the code to work in polling and now it works

View solution in original post

0 Kudos