SD booloder for debug

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 32-bit PIC MCUs
Author
Message
hooper
Posts: 143
Joined: 23 Oct 2009 08:51

Re: SD booloder for debug

#16 Post by hooper » 20 Oct 2017 15:53

Hi Kian,

Modification of the bootloader from SD card to a USB stick should be a simple task.
Just follow the USB HOST sample project to get yourself familiar with the usage of FAT32 and the USB stick.
Now, change the access reading functions from Sd card to the USB.
Generaly thats all ( you will of course move some logic to the USB service routine, but it should not be too complicated task).
Take care as well about the code size since if it will span more flash pages than mine then you will have also to modify the adresses locations
of the user application ( otherwise your user application will destroy the bootloader code...)

Wish you luck and see your project in Libstock.
Hooper.

hooper
Posts: 143
Joined: 23 Oct 2009 08:51

Re: SD booloder for debug

#17 Post by hooper » 20 Oct 2017 21:47

Hi Kian,

I have not noticed that your target
I might assume that the general program structure should be the same
But you have to take care about the address space issues.

feuerwolf
Posts: 95
Joined: 09 Nov 2012 16:00
Location: Switzerland

Re: SD booloder for debug

#18 Post by feuerwolf » 21 Oct 2017 00:09

Is it actally possible to edit the topic of this post? I just noticed its booloder instead of bootloader. :lol:

hooper
Posts: 143
Joined: 23 Oct 2009 08:51

Re: SD booloder for debug

#19 Post by hooper » 21 Oct 2017 07:18

feuerwolf wrote:Is it actally possible to edit the topic of this post? I just noticed its booloder instead of bootloader. :lol:
Not sure if it is possible

hosseinildar
Posts: 53
Joined: 16 Mar 2017 20:48

Re: SD booloder for debug

#20 Post by hosseinildar » 21 Oct 2017 15:21

hooper wrote:Hi Kian,

I have not noticed that your target
I might assume that the general program structure should be the same
But you have to take care about the address space issues.
Dear Hooper,
Very thanks to your comment's,
I'll working on it.
My MCU is STM32F407.

H.Kian
H.Kian
Best Regards

feuerwolf
Posts: 95
Joined: 09 Nov 2012 16:00
Location: Switzerland

Re: SD booloder for debug

#21 Post by feuerwolf » 22 Oct 2017 10:54

find the CheckSum Checker is now on Libstock as well

https://libstock.mikroe.com/projects/vi ... code-lines

yzzo
Posts: 12
Joined: 06 Oct 2018 16:43

Re: SD booloder for debug

#22 Post by yzzo » 23 Apr 2022 17:39

Hi everybody,

I'm tring to adapt this useful bootloader for the PIC32MX170F256B, but I'm encountering many problems.
The code I have started from, is the following: https://libstock.mikroe.com/projects/vi ... bootloader

I think to have adapted correctly the bootloader, but I'm not able to compile the application to test, because when I set the #pragma orgall, as explained in the previous page of this topic, as well as in the .pdf files attacched to above link,
_________________________________________________
#define USER_APP_RESRT_ADDR 0x09D00A000
#define ConfigMem(); \
OrgAll(USER_APP_RESRT_ADDR); \
FuncOrg(__BootStartUp,USER_APP_RESRT_ADDR);
_________________________________________________

the compiler tell me that there are not enough ROM.....

Image

These are my project settings:

Code: Select all

DEVCFG3 : $1FC00BF0 : 0x00000000
DEVCFG2 : $1FC00BF4 : 0x00010071
DEVCFG1 : $1FC00BF8 : 0x0354C701
DEVCFG0 : $1FC00BFC : 0x1107FC1B
The code is very simple:

Code: Select all

//uC: PIC32MX170F256B
//Ck: 48MHz (8MHz - PLL input divider x2, PLL multiplier x24, PLL output divider x2)

#define USER_APP_RESRT_ADDR 0x09D00A000
#define ConfigMem();  \
        OrgAll(USER_APP_RESRT_ADDR); \
        FuncOrg(__BootStartUp,USER_APP_RESRT_ADDR);



void main() {
ConfigMem();

TRISA.F2 = 0;      //LED
TRISA.F4 = 1;      //SWITCH

TRISB.F4 = 0;      //SW-RST
LATB.F4 = 0;       //SW-RST off

DisableInterrupts();

while(1)
{
LATA.F2 = 1;
Delay_ms(2000);
LATA.F2 = 0;
Delay_ms(2000);
}
}
I tried also this:

Code: Select all

#pragma orgall 0x9D00A000
#pragma funcorg __BootStartUp 0x9D00A000
but the problem remains :|

Without orgall directive the compiler, compiles without problems.....
Can someone help me, please?
Thanks in advance.

yzzo
Attachments
Cattura.PNG
Cattura.PNG (11.59 KiB) Viewed 1886 times

Post Reply

Return to “PIC32 PRO Compilers”