The asm file Dan_tinybld18F23K22-43K22-24K22-44K22-25K22-45K22-26K22-46K22_int16MHz_19200_r3.hex was adapted for 24K22 with the following settings
#include "p18f24k22.inc"
IdTypePIC = 0x62 ; Please refer to the table below, must exists in "piccodes.ini" #define max_flash 0x4000 ; in WORDS, not bytes!!! (= 'max flash memory' from "piccodes.ini" divided by 2), Please refer to the table below #define SELECTEUSART 1 ; EUSART(1/2), Please refer to the table below #define EEPROMSIZE 256 ; Size of EEPROM **
xtal EQU 16000000 ; you may also want to change: _HS_OSC _XT_OSC
baud EQU 19200 ; standard TinyBld baud rates: 115200 or 19200
The windows bootloader software responds on check device as follows.
Check Device...
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Close COM10 serial port
When a hex file created with jalv2 is passed and when the check hex file option is used it gives a message
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Open HEX file: D:\Desktop\bltest.hex
Error: Hex file for PIC16F, PIC family mismatch.
Close COM10 serial port
If the option is unchecked the response is
---------------------------------------------------------
Check Device...
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Open HEX file: D:\Dropbox\Projects\HW\PIC\JAL\test\18F24k22\18f24k22_BL_test.hex
Transferring flash...
Transferring program memory...
Transferring HEX successfull :-)
Close COM10 serial port
But the user program doesn't seem to get executed.
Looks like the address of the user program is not updated correctly by the bootloader in the PIC.
With just the bootloader, the program memory address 0x000 has GOTO 0x3F40
0x3F40 has the bootloader code and 4 NOPS are present from 0x3F38 to 0x3F3E
On loading the user program, the address from 0x3F38 to 0x3F3E does not point to user program address.
Is it because of the PC software or it has anything to do with the compiler ?
Best regards,
Sunish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried both r3 and r4 and also modified r5 for 18F26k22. PC software works with r3 and r4 without problems but the uploaded code is not executed. When check hex file option is given in PC software I get the message "Error: Hex file for PIC16F, PIC family mismatch."
r5 modified asm file gives the message
MPLINK 4.49, Linker
Device Database Version 1.14
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - section '.org_3' can not fit the absolute section. Section '.org_3' start=0x0000ff40, length=0x000000c2
Errors : 1
Best regards,
Sunish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Dan,
Thanks for your reply.
I am not able to get the bootloader working with JAL and 18F2xk22 series
PICs.
I get the reply from bootloader within the PC software with r4 asm files.
When I click write hex file I get wrote successfully.
Check Device...
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Close COM10 serial port
When a hex file created with jalv2 is passed and when the check hex file
option is used it gives a message
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Open HEX file: D:\Desktop\bltest.hex
Error: Hex file for PIC16F, PIC family mismatch.
Close COM10 serial port
For other series than 18f I have no problems and it works with the compiler
pragma mentioned long back.
For 18f jalv2 compiler pragma for setting bootloader is different and it
indeed works with Microchip and other bootloaders.
The last messages which I posted was to adapt the r5 version to 18f26k
which is irrelevant as I get the bootloader reply correctly from r4 and r5
only addresses the second UART issue.
My conclusion is that it's not a problem with asm firmware,but I the PC
software is not fixing the address correctly for 18f series with hex file
created by jalv2.
Regards,
Sunish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Please don't care about this error message. Your firmware should be correct and the transfert will be ok. It's just I'm not able to discriminate PIC16 Enhanced hex files and PIC18 ones :-(
Best regards,
Edorul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Please don't care about this error message. Your firmware should be
correct and the transfert will be ok. It's just I'm not able to
discriminate PIC16 Enhanced hex files and PIC18 ones :-(
Best regards,
Edorul
The asm file Dan_tinybld18F23K22-43K22-24K22-44K22-25K22-45K22-26K22-46K22_int16MHz_19200_r3.hex was adapted for 24K22 with the following settings
#include "p18f24k22.inc"
IdTypePIC = 0x62 ; Please refer to the table below, must exists in "piccodes.ini"
#define max_flash 0x4000 ; in WORDS, not bytes!!! (= 'max flash memory' from "piccodes.ini" divided by 2), Please refer to the table below
#define SELECTEUSART 1 ; EUSART(1/2), Please refer to the table below
#define EEPROMSIZE 256 ; Size of EEPROM **
xtal EQU 16000000 ; you may also want to change: _HS_OSC _XT_OSC
baud EQU 19200 ; standard TinyBld baud rates: 115200 or 19200
The windows bootloader software responds on check device as follows.
Check Device...
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Close COM10 serial port
When a hex file created with jalv2 is passed and when the check hex file option is used it gives a message
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Open HEX file: D:\Desktop\bltest.hex
Error: Hex file for PIC16F, PIC family mismatch.
Close COM10 serial port
If the option is unchecked the response is
---------------------------------------------------------
Check Device...
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Open HEX file: D:\Dropbox\Projects\HW\PIC\JAL\test\18F24k22\18f24k22_BL_test.hex
Transferring flash...
Transferring program memory...
Transferring HEX successfull :-)
Close COM10 serial port
But the user program doesn't seem to get executed.
Looks like the address of the user program is not updated correctly by the bootloader in the PIC.
With just the bootloader, the program memory address 0x000 has GOTO 0x3F40
0x3F40 has the bootloader code and 4 NOPS are present from 0x3F38 to 0x3F3E
On loading the user program, the address from 0x3F38 to 0x3F3E does not point to user program address.
Is it because of the PC software or it has anything to do with the compiler ?
Best regards,
Sunish
Hi Sunish
The following files are updated by the bug.
Dan_tinybld18F23K22-43K22-24K22-44K22-25K22-45K22-26K22-46K22_int16MHz_19200_r3.asm
The latest files are located here.
https://sourceforge.net/p/tinypicbootload/discussion/devices/thread/19d5ece8/#9829
2015.03.22.zip
Dan_tinybld18F23K22-43K22-24K22-44K22-25K22-45K22-26K22-46K22_int16MHz_19200_r4.asm
Best regards,
Dan
I tried both r3 and r4 and also modified r5 for 18F26k22. PC software works with r3 and r4 without problems but the uploaded code is not executed. When check hex file option is given in PC software I get the message "Error: Hex file for PIC16F, PIC family mismatch."
r5 modified asm file gives the message
MPLINK 4.49, Linker
Device Database Version 1.14
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - section '.org_3' can not fit the absolute section. Section '.org_3' start=0x0000ff40, length=0x000000c2
Errors : 1
Best regards,
Sunish
Error - section '.org_3' can not fit the absolute section.
Section '.org_3' start=0x0000ff40, length=0x000000c2
Code that you have created is beyond the 192 bytes (96 words).
To use it you have to make the following changes.
(source)
define first_address max_flash-200 ;100 words
(piccodes.ini)
$62, C, 18F w/16KB flash & 256B EEPROM, $4000, $100, default, default,
---->
(source)
define first_address max_flash-264 ;132 words
(piccodes.ini)
$62, C, 18F w/16KB flash & 256B EEPROM, $4000, $100, 264, default,
In the case of TypePIC=0x62,100words
org_3 is start = 0x00003f40, end = 0x00003fff
It will be set to.
In the case of TypePIC=0x62,132words
org_3 is start = 0x00003f00, end = 0x00003fff
It will be set to.
Best regards,
Dan
Last edit: Dan 2016-05-20
Dear Dan,
Thanks for your reply.
I am not able to get the bootloader working with JAL and 18F2xk22 series
PICs.
I get the reply from bootloader within the PC software with r4 asm files.
When I click write hex file I get wrote successfully.
Check Device...
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Close COM10 serial port
When a hex file created with jalv2 is passed and when the check hex file
option is used it gives a message
Open COM10 serial port at 19200bd
Found: 18F w/16KB flash & 256B EEPROM
Open HEX file: D:\Desktop\bltest.hex
Error: Hex file for PIC16F, PIC family mismatch.
Close COM10 serial port
For other series than 18f I have no problems and it works with the compiler
pragma mentioned long back.
For 18f jalv2 compiler pragma for setting bootloader is different and it
indeed works with Microchip and other bootloaders.
The last messages which I posted was to adapt the r5 version to 18f26k
which is irrelevant as I get the bootloader reply correctly from r4 and r5
only addresses the second UART issue.
My conclusion is that it's not a problem with asm firmware,but I the PC
software is not fixing the address correctly for 18f series with hex file
created by jalv2.
Regards,
Sunish
Hi,Sunish
I tried in JALV2.
In the case of PIC18 you can generate a jump code in the following specification.
PRAGMA BOOTLOADER LOADER18 2
BLOADER ---> Improper
LONG_START ---> Invalid
RICKPIC ---> Improper
Best regards,
Dan
Last edit: Dan 2016-05-21
Hello Dan,
Thanks for putting the effort in trying with jal. BLOADER works with 16F series and I had known that only LOADER18 works with 18F.
Thanks a ton. I can confirm that tiny Multiloader works with 18f24k22.
However I still get the error message
Error: Hex file for PIC16F, PIC family mismatch.
while using the PC bootloader software with the Check Hex file option ticked.
Thanks and best regards,
Sunish
Hello,
Please don't care about this error message. Your firmware should be correct and the transfert will be ok. It's just I'm not able to discriminate PIC16 Enhanced hex files and PIC18 ones :-(
Best regards,
Edorul
Thanks for the info. BTW just noticed that in many places in UI as well as
documentation you have a spelling mistake "transfert" instead of transfer.
Sunish
On May 22, 2016 3:41 PM, "edorul" edorul@users.sf.net wrote:
Thanks, I'll modify that.
If you see more spelling mistakes in the PC software, don't hesitate to tell.