Eric - 2017-04-26

Hello forum,

I am trying to get the tinybld working on the PIC18F46J50. For testing, I have gotten the tinybld working on the PIC16F1827 successfully.

My problem is when I write the hex file via the Tiny Multi Bootloader+ (v0.11.0) to the device, app crashes. I did select all debug messages and this is what is generated:

Check device...
send: C1
receive: 32, 4A

In the main message window, checking the device shows:

Check Device...
Open COM4 serial port at 19200bd
   Hardware RTS reseting Device
   Found: 18F(J) w/64KB flash & 0B EEPROM
Close COM4 serial port

---------------------------------------------------------

When I go to write to the device is shows:

Check Device...
Open COM4 serial port at 19200bd
   Hardware RTS reseting Device
   Found: 18F(J) w/64KB flash & 0B EEPROM
Open HEX file: path/to/my/HEX/file.hex

then crashes.

I did get it to work once, but only once. Even in simulation mode the app crashes. I used this line from the "piccodes.ini" file for the "Virtual Device"

$32, J, 18F(J) w/64KB flash & 0B EEPROM,  $10000,    0, default, default,

My c program is compiled with the XC8 compiler. The program is super simple:

// config omitted

#include <xc.h>

void interrupt isr(void) {
    return;
}

void main(void) {
    return;
}

In the linker options, Memory Model, ROM ranges:

default,-fE37-ffff

Here is the hex file:

:040000003DEF00F0E0
:10000800FACF01F0FBCF02F0E9CF03F0EACF04F01A
:10001800E1CF05F0E2CF06F0D9CF07F0DACF08F04C
:10002800F3CF09F0F4CF0AF0F6CF0BF0F7CF0CF0CE
:10003800F8CF0DF0F5CF0EF00EC0F5FF0DC0F8FFAC
:100048000CC0F7FF0BC0F6FF0AC0F4FF09C0F3FFAE
:1000580008C0DAFF07C0D9FF06C0E2FF05C0E1FF0C
:1000680004C0EAFF03C0E9FF02C0FBFF01C0FAFFBA
:1000780011003FEF00F0000142EF00F03DEF00F00B
:08FFF800EEF7DCFFFFF9FFF159
:00000001FF

Any tip would be very much appreciated

Update:

With the same hex file as above I found a way to generate more debug messages:

Check Device...
Open COM4 serial port at 19200bd
   Hardware RTS reseting Device
   Device answer: 0x32 0x4A='J'
    byte OK, now check ID-code and Family...
      idCode = $32
      family = J
      description = 18F(J) w/64KB flash & 0B EEPROM
      flash mem = 65536 bytes
      EEPROM mem = 0 bytes
      Bootloader size = 264 bytes
      Transfert block size = 64 bytes
   Found: 18F(J) w/64KB flash & 0B EEPROM
Open HEX file: C:\my\path\to\file.hex
Checking hex file: 
   Hex file end line
   HEX sumary: INX8M, 
               PIC16F + eeprom, 
               total=22 bytes.
Error: Hex file for PIC16F, PIC family mismatch.
WARNING: Nothing was written!
Close COM4 serial port

What I find strange is in the last few lines:

               PIC16F + eeprom, 

is found, i've double cheched my complier setting and it is configured for the PIC18F46J50.

I hope this helps someone help me.

 

Last edit: Eric 2017-04-27