• AVR Freaks

Hot!Some question about PIC32MZ boot

Author
Andy56
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2016/06/18 12:46:25
  • Location: 0
  • Status: offline
2019/06/23 13:03:38 (permalink)
0

Some question about PIC32MZ boot

I have some doubts about boot on PIC32MZ family.
I can't understand what happen when bootloader starts to execute program pointing to the first instruction address. It will be maintained hardware configuration contained in bootloader program  (specially memory mapping declared)? Or will be suppressed by loaded program?
 
In my application I want to load program by bootloader, with serial connection. But I should configure uC to use external RAM. I suppose I have to map external RAM in boot program. But I'm not sure that it will be suppressed when the final program it will received and started.
#1

11 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 17915
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/23 13:48:25 (permalink)
    0
    A bootloader is a stand alone program.
    It executes like any other.
    In a typical PIC32 bootloader, it will run check to see if it is needed. If not it will jump to the main program. This is not the only way to handle a bootloader.
    #2
    ric
    Super Member
    • Total Posts : 24186
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/23 15:03:05 (permalink)
    0
    As above.
    To be clear, the PIC itself does not magically change/switch anything when the bootloader jumps to the application.
    The bootloader has total control, and it it the bootloader's responsibility to configure the PIC as required before jumping to the application.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    Andy56
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2016/06/18 12:46:25
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/24 13:26:51 (permalink)
    0
    Ok really interesting. Thank you very much for your answers lined up.
    So I can estimate to use bootloader and succesfully configure external RAM and Flash memory needed to store and execute the application program: i.e. (for the sake of clarity) U-boot .
    So when U-boot starts, it maintains the external RAM/Flash configured and other hardaware settings (like oscillator, Serial, Spi and so on). Is that correct?
    External Flash memory should store RTOS, pointed by U-Boot.

    I look forward yours confirmation.
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 17915
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/24 14:00:13 (permalink)
    0
    NO. 
    The Bootloader does not Have to configure anything for the Application.
    U-boot?  Are you trying to run Linuix or something like that?  That is a different Question.
    Most RTOS (ie FreeRTOS, uOS)  are part of the Main Application and would be configured there.
     
    You Need to explain your actual issue.  If it is an ordinary Bootloader/ Application you are very wrong.
     
    #5
    Andy56
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2016/06/18 12:46:25
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/24 14:22:00 (permalink)
    0
    Yes, I want to run Linux Embedded. So I suppose to load simple bootloader who can configure hardware, in particular external Flash memory and RAM. This bootloader should jump to U-boot or receive new compiled U-boot version (from host PC serial).
    Embedded Linux I suppose to store in external fash memory and U-boot should load RTOS from there.
     
    So can you provide me explanation about, and some examples to run Linux Embedded in PIC?
    #6
    Jim Nickerson
    User 452
    • Total Posts : 6326
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    NKurzman
    A Guy on the Net
    • Total Posts : 17915
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/25 09:42:23 (permalink)
    0
    Google "PIC32MZ run linux" and have at it. 
    You are mixing up the Term Bootloader.
    In Your case U-Boot must set up what ever U-Boot Needs.  A Linux Bootloader is Not necessarily the same type of program and a bootloader that loads a stand alone PIC32 Program.
    If you have a Linux Question, then you need to ask it that way.
    But I can tell you I do not see alot of PIC32 Linux talk on this Forum.
    #8
    Andy56
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2016/06/18 12:46:25
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/25 13:33:00 (permalink)
    0
    Many thanks.
    Your replies are very useful. 
    I need to explain more in depth what I suppose for my project. 
    I say bootloader (but in reality it's a first stage of boot program). This should apply preliminary configuration in PIC device, as Serial to connect host PC. I should send by PC Serial new compiled version of U-Boot, and the first stage bootloader receives and store this. If not, it will jump to Application (U-boot previous stored).
     
    I suppose to use external RAM and flash memory. The second one it will store RTOS.
     
    So the main questions are:
     
    -  first stage of boot program must set only to Serial in PIC hardware (to connect host PC and receives U-boot)? Or should it configure external RAM, flash memory and other uC's modules that I need to use after when RTOS starts?
    - When U-boot starts, will it reset all hardware settings imposed by first stage boot? Or should U-Boot be the real "configurator" for resources in PIC?
     
    I hope I'm making myself clear
     
    #9
    NKurzman
    A Guy on the Net
    • Total Posts : 17915
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/25 14:29:30 (permalink)
    0
    So you want a Bootloader to put U-Boot on the PIC?
    If you then The Bootloader is a Normal PIC32 Bootloader.  U-Boot is the Application.
    The  Normal PIC32 Bootloader will do nothing for U-Boot except to install where it says it needs to be.  And to jump to it when the PIC32 starts up.If you have some other need then it is not clear to me.
     
    what do you mean by stored?  Are you putting something on a USB or SD-Card?
    #10
    Andy56
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2016/06/18 12:46:25
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/26 12:48:54 (permalink)
    0
    So the challenge now is to configure U boot for compiling. I assume I have to set hardware for external RAM and Flash memory here. I look forward hardware setting in Readme guide for U-Boot (I have found particular project for this purpose called U-Boot_PIC32).
     
    Yes I plan to use an external Flash memory (SD card) storing RTOS (Linux Embedded Kernel and File System). I assume that U boot needs to point to this resource and transfer RTOS from flash mem, to external RAM.
    I'm not wrong, am I?
    #11
    NKurzman
    A Guy on the Net
    • Total Posts : 17915
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Some question about PIC32MZ boot 2019/06/26 13:11:33 (permalink)
    0
    You Plan to Run Linux from RAM?  The PIC32 is MIPS.  Google and see if it has been done. I do not know if it can, or already has been done.
     
    I can tell you the PIC32 MZ  DA Chips have a lot of RAM.  I am not sure how much you need.
    #12
    Jump to:
    © 2019 APG vNext Commercial Version 4.5