• AVR Freaks

Helpful ReplyNo Harmony Support for SD Card Bootloader?

Author
red_five
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2016/05/10 15:07:54
  • Location: 0
  • Status: offline
2016/05/11 14:17:49 (permalink)
0

No Harmony Support for SD Card Bootloader?

I have been struggling for weeks trying to build a working SD card Bootloader for my PIC32MX570F512H based project, with absolutely no success. I know my target hardware is OK as I can build the Harmony SD card file system example and it runs fine. My main project app (USB-CANbus converter) I wrote from scratch and also works correctly.
 
The Harmony library documentation and Harmony Configurator only ever refers to USB, UART or UDP Bootloaders but that's not what I need.
 
I have tried to use the A1388 sample code but, although I can get it compile in MPLAB X and have changed the processor and I/O allocations to suit my target, the file system doesn't work and it can't detect that an SD Card is inserted either by hardware or software detection. I can get it to flash the LEDs on my board, but that's about it. Bypass the card detection code and it fails to mount the filesystem. 
I'm just about at the end of my tether, I just need a simple SD card bootloader and don't understand why it's not included in Harmony or why the the AN1388 sample doesn't work.
 
Any help would be very gratefully received.
 
Thanks in advance
#1
Larry.Standage
Moderator
  • Total Posts : 927
  • Reward points : 0
  • Joined: 2011/12/30 09:50:47
  • Location: 0
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/05/20 22:28:40 (permalink)
0
The key is going to be in the datastream files under framework/bootloader/datastream. If you look at the USB Host one, that would give you a pattern for creating the SD Card version.
#2
NKurzman
A Guy on the Net
  • Total Posts : 18027
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/05/20 23:43:53 (permalink)
3 (1)
Basically you need to build the harmony USB bootloader app.
Then move the bootloader code in to you app. You will need to move the data steam files too.
Fix up the includes and project so it can build.
You can edit the bootloader files as needed. The are based on your app note.
Now add the sdcard to the project. Delete the USB and the bootloader.
And then you will need to Handle the sdcard similar to the USB. Both are going to open a file.
#3
ThomasRhoon
Starting Member
  • Total Posts : 53
  • Reward points : 0
  • Joined: 2014/01/22 14:42:08
  • Location: 0
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/09/07 02:29:12 (permalink)
0
Did you have succes with it? I am in the same situation but i am not really interrested to dig some weeks into all the harmony overload.
#4
ThomasRhoon
Starting Member
  • Total Posts : 53
  • Reward points : 0
  • Joined: 2014/01/22 14:42:08
  • Location: 0
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/10/17 08:26:03 (permalink)
4 (2)
I didn't follow it further yet but i just saw that a direct SD Card bootloader is added to the new Harmony V2.01b.
I will check if the basics work as expected.
#5
ThomasRhoon
Starting Member
  • Total Posts : 53
  • Reward points : 0
  • Joined: 2014/01/22 14:42:08
  • Location: 0
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/10/19 02:13:43 (permalink) ☄ Helpfulby martinw7750 2016/10/19 04:04:07
3 (1)
Just for your information. Tested the basic SD card bootloader and it works well.
#6
martinw7750
Super Member
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2013/05/28 01:31:19
  • Location: UK
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/10/19 04:19:50 (permalink)
0
ThomasRhoon
Just for your information. Tested the basic SD card bootloader and it works well.


that's good to know.
I tried to build it yesterday but MHC said it failed to initialise.  Not sure if I had 2.00 or 2.01 mhc installed, will try again today.
 
What does the SD bootloader actually do?
Does it take an image from the sd card to program into flash?
#7
ThomasRhoon
Starting Member
  • Total Posts : 53
  • Reward points : 0
  • Joined: 2014/01/22 14:42:08
  • Location: 0
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/10/19 04:33:05 (permalink)
4 (1)
Yes, generally, it checks for special buttons pressed on startup, and if they are pressed, it checks on the SD card (via SPI) for a boot.hex file (which is your renamed main project .hex) and if it finds it, it flashes your PIC form that file and starts to the application, once finished.
 
Though some work has to be done to get it running:
- Change the SPI ports and button port readouts to your needs.
- Add a special linker file to your main application. ( The bootloader manual gives you information about that. Easy to do if you have a harmony project anyway, and some handwork needed if your main project is not (in) harmony (like mine).
 
But once done, it does the job.
#8
martinw7750
Super Member
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2013/05/28 01:31:19
  • Location: UK
  • Status: offline
Re: No Harmony Support for SD Card Bootloader? 2016/10/19 06:25:59 (permalink)
0
Thanks, sounds like just what I need.
 
also can now build the demo - I had MHC 2.00 isntalled rather than 2.01
#9
Jump to:
© 2019 APG vNext Commercial Version 4.5