bootloader

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

bootloader

#1 Post by waytec.fr@gmail.com » 16 Nov 2023 10:22

Hi everybody,
i have to do a bootloader in order that my customer can upload firmware. I have take a look on the bootloader example, it doesn't use any control of uart send, is it a problem, what happend if there is a transmission error on one byte ?
should i put a checksum control or somthing ?

Thank's.
Last edited by waytec.fr@gmail.com on 16 Nov 2023 18:03, edited 1 time in total.

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: bootloader

#2 Post by IvanJeremic » 16 Nov 2023 13:58

Hi,

There shouldn't be any issue, the code uses UART but it does not use the available libraries, instead it uses Uart functions built in the code (it maybe called susart or something like that).

Regards,

Ivan.

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#3 Post by waytec.fr@gmail.com » 16 Nov 2023 16:46

i try to understand how work the bootloader and windows prog, i don't.
In the hex file, the win prog write the data bytes from line 1 to line 7, then jump to line 2558, sometime adds FF , i'm a bit lost

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#4 Post by waytec.fr@gmail.com » 16 Nov 2023 17:53

i don't understand how the .hex file is structured, how passing from code to .hex ?

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#5 Post by waytec.fr@gmail.com » 16 Nov 2023 17:54

how passing from .hex to prog memory ?

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#6 Post by waytec.fr@gmail.com » 16 Nov 2023 18:01

why do you erase my previous messages ? it is top secret the . hex ?

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#7 Post by waytec.fr@gmail.com » 17 Nov 2023 10:13

oh, i kwowed nothing about bootloader and hex files, now i learned, i'm doing a win parser with visual studio to have bin file,
For securising the transmision, i wish to add a control, i thing doing this as siple as : pc sends a byte, pic resend it, if pc reads byte as it has send, continue, else abort. Do you think it is sufficient to avoid errors ?

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: bootloader

#8 Post by IvanJeremic » 17 Nov 2023 16:39

Hi,

The first part of the HEX is basically a pointer tell the MCU where the BOOTLOADER is, everything else is empty that is where your code will go and the final part is the actual BOOTLOADER.

Your posts were not deleted, you just need to have a couple of your first posts approved before you can post freely.

Regards,

Ivan.

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#9 Post by waytec.fr@gmail.com » 20 Nov 2023 09:27

i do a basic win program in visual basic, that follow the needs of the bootloader ; at the reception of "yy", send first byte of bin file, at reception of "xx", send second byte, at reception of "yy", third byte and so on. but don't works. all works fine until 64000 bytes more or less, and then the win app don't receive nothing, and the bootloader is disappeared from pic. i verified, the bin file is well extracted from hex file, so what can be the problem ? trying to upload with mikrobootloader, it works, and seems that it send bytes by bytes from bin file ?

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: bootloader

#10 Post by IvanJeremic » 21 Nov 2023 08:08

Hi,

Are you using the BOOLOADER example from our compiler for the specific MCU that the BOOTLOADER was made for, or some other MCU?

If you are using it for some other MCU then i can not guarantee that it will work even if you make changes that are specified in the comments of the example code.

Regards,

Ivan.

waytec.fr@gmail.com
Posts: 8
Joined: 16 Nov 2023 10:19

Re: bootloader

#11 Post by waytec.fr@gmail.com » 21 Nov 2023 22:17

the bootloader works grea with your win app, but not with mine
To be clear, the win app convert hex file in bin file and send byte to byte to pic, right ?

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: bootloader

#12 Post by IvanJeremic » 23 Nov 2023 09:20

Hi,

Our application does not convert the hex to bin, it just sends the hex file byte to byte to PIC.

Regards,

Ivan.

Post Reply

Return to “mikroBasic PRO for PIC General”