News:

;) This forum is the property of Proton software developers

Main Menu

Bootloader Issues with Tiny Multibootloader

Started by JohnB, May 15, 2026, 11:09 AM

Previous topic - Next topic

JohnB

I don't know if others have had similar problems but I have had a couple of bootloaders from Evan which only work once with my programs because my program is writing into the first 8 locations corrupting the vector to the bootloader.

This is the message (see attached) when I upload my program to my device.  The uploaded program runs fine but when I reboot it does not re-enter the bootloader.

I have bootloader = on in my declares, how many bytes does the compiler leave free when bootloader is enabled?

I dont want to waste any more money with Evan if the compiler is causing the problem.
JohnB

trastikata

#1
Quote from: JohnB on May 15, 2026, 11:09 AMI have bootloader = on in my declares, how many bytes does the compiler leave free when bootloader is enabled?
I dont want to waste any more money with Evan if the compiler is causing the problem.

John,

How many bytes the compiler will leave depends on your declare: "Declare Compiler_Start_Address"

The problem is in the Bootloader that probably accepts FLASH addresses effectively overtiring itself.

My bootloaders will always return a write error if FLASH address will cause it to overwrite itself.

JohnB

#2
I should have mentioned, I am using the 16F family of devices which it seems the compiler doesnt support the Declare Compiler_Start_Address,  Does this mean you cannot use TinyMultiBootloader with devices less than the 18F series?  Can any one recommend a bootloader which will work with 16F devices.

Further to this, discussions with Evan it appears that NOP's are inserted at the begining of the code rather than leaving erased as $3FFF
JohnB

top204

#3
The Tiny bootloader is located at the top of flash memory, and it should be copying all of the code memory from address 0x00 to address 0x03, because that is the start-up space on 14-bit core devices, and it will often contain more than just a jump, because the 14-bit core devices (including the enhanced types) have a paged flash memory. Hence the Movlp mnemonic that precedes it, on enhanced 14-bit core devices with more then a single page of flash memory.

The standard assembler start for the compiler with a 14-bit core device is:

_compiler__start_
    org 0x00
    nop
    nop
    movlp ((_compiler_main_start_) >> 8)
    goto _compiler_main_start_
    org 0x04


But it seems that the bootloader has taken a step backwards with its later iteration and it must only be copying the first 2 words now. So use the declare:

Declare Bootloader = On

And the assembler code will be:

_compiler__start_
    org 0x00
    movlp ((_compiler_main_start_) >> 8)
    goto _compiler_main_start_
    nop
    nop
    org 0x04


I originally had the formation change because of an anomaly in some standard 14-bit core devices many years ago, so a jump to an address at the address 0x00 could cause problems when a device was first powered up, but that will not be the case now, so I will change it back to standard address 0x00 being the jump to the main program.

The Declare was also in the compiler manual until a few years ago, when I thought it was now redundant.

Regards
Les

JohnB

Thank y ou Les, at least that clarifies some issues.  Evan says the bootloader has not been changed but he will be looking into the issues I am having with his loader this week. If anything arises I will report back.
JohnB