Reprogramming dsPIC33EP521GM710 with data read from RN4020 interface

Author
jhmicrochip
New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2017/06/27 05:35:54
  • Location: 0
  • Status: offline
2018/06/13 10:26:47 (permalink)
0

Reprogramming dsPIC33EP521GM710 with data read from RN4020 interface

I know the bootloader options available 2-wire UART,USB and I2C.  Right now
I'm looking at loading BLE data into ram and using Flash Programming method
or can I use ICSP or enhanced ICSP? Looking for the best solution.
 
Thanks
#1

3 Replies Related Threads

    Aussie Susan
    Super Member
    • Total Posts : 3196
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: Reprogramming dsPIC33EP521GM710 with data read from RN4020 interface 2018/06/13 19:58:59 (permalink)
    0
    As with most design decisions, what is best really depends on a lot of factors that only you can really know.
    By ICSP or Enhanced ICSP I assume that you are looking to design some circuitry that will connect to the \MCLR\ and the PGExn pins and emulate a PicKit (or whatever). That is certainly possible and does allow for programming external to any code you run in the MCU but does require hardware and your own firmware (unless you clone something).
    Where is the BLE data held? In the MCU's RAM or in an external EEPROM (which is where I'd put it so I verify checksums etc. before clobbering my MCU's code)? If this is more what you are thinking then RTSP is probably a better way to go.
    However you also mention bootloaders which typically use a serial port of some sort and then use RTSP directly on whatever they are fed. Again you probably will need something external to the MCU to trigger the bootstrap process and then communicate with it via the serial lines.
    Susan
    #2
    jhmicrochip
    New Member
    • Total Posts : 24
    • Reward points : 0
    • Joined: 2017/06/27 05:35:54
    • Location: 0
    • Status: offline
    Re: Reprogramming dsPIC33EP521GM710 with data read from RN4020 interface 2018/06/14 05:51:06 (permalink)
    0
    I probably will store the data in a 256K SPIBus Serial EEPROM. If the part (dsPIC33EP512GM710)had a dual partition feature it would be very easy.  If I'm executing out of my original code area:
    1.Where do I start loading my new code?
    2. Can I use a GOTO instruction to get to the new code?
     
    Thanks
    #3
    Aussie Susan
    Super Member
    • Total Posts : 3196
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: Reprogramming dsPIC33EP521GM710 with data read from RN4020 interface 2018/06/14 19:45:13 (permalink)
    0
    Again, that is part of your design.
    You could set aside a section of code at (say) the very top of memory and not over-write that. You can just to that part of the code when you are ready to start transferring the data from the EEPROM to the FLASH memory (where you validate the new code is up to you). That way you can make sure the code does not over-write itself. When you are done, you can do a 'reset' which will then start the new code running.
    I'm not sure what you mean by a 'goto' to get to the new code. There is always an effective 'goto' at program location 0 which is how resets are make to work. All traps and interrupt that have a vector location hold an address of the routine to be executed when the trap/interrupt is triggered. If you have not supplied such a function, then the address is set to '0' which is the 'reset' vector. 
    In this program location, you are supposed to have written an 'GOTO <start address>' instruction if you use assembler, or the C compilers will do this for you. This is the way you code always starts at power on, after a reset or when you don't write a function for a triggered trap/interrupt.
    Of course, if you write your own bootloader and set up your own rules (i.e.load the program into some other part of memory using a customised linker script) then you need to follow your own rules.
    Susan
    #4
    Jump to:
    © 2018 APG vNext Trial Version 4.5