Code Offset bug ?

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
User avatar
faveremario
Posts: 28
Joined: Sat Jun 02, 2012 6:08 pm
Has thanked: 8 times
Been thanked: 13 times
Contact:

Code Offset bug ?

Post by faveremario »

Hi all,

I wrot a small FC6 program (for PIC18f2455) using the linker directive : -rb 0x1000 (for using with the µchip HID bootloader)
When I look at the code, I see that it starts @ 0x800 in stead of 0x1000 !

In attachement the HEX-file.
ANy suggestions are welcome...

I'm using FC6.1.1.0


greetz
Attachments
USBSerial.hex
Linked with the -rb 0x1000 directive.
(11.64 KiB) Downloaded 224 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Code Offset bug ?

Post by kersing »

It would be better if you posted your flowchart and export of the compiler and linker settings for us to look at.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Code Offset bug ?

Post by LeighM »

The hex file attached looks like it does start at 0x1000, to me

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Code Offset bug ?

Post by Benj »

Yes I agree with Leigh, All memory locations before address 0x1000 are NOPs.
SSMem.jpg
SSMem.jpg (98.07 KiB) Viewed 3937 times


I used MPLAB to get this program memory listing from your hex file.

User avatar
faveremario
Posts: 28
Joined: Sat Jun 02, 2012 6:08 pm
Has thanked: 8 times
Been thanked: 13 times
Contact:

Re: Code Offset bug ?

Post by faveremario »

Hi all

Now today I found 'a solution' and why i tought the code-offset was wrong.
I opened the hex with notepad & saw the code started at 0x1000, so my first impression was wrong.

I was mislead by the way the HID-bootloader functions : when in bootloader is initiated (a button must be pressed while initiating) & connected to the PC, 2 led’s are alternatedly blinking.
After the programming, we reset the PIC without pressing the ‘bootloader’-button so the user-program is starting to run.
But this did not happen…. The bootloader sequence was entered. This is generaly a sign that the user-program has not been transferred into the PIC (very often related to code-offset mismatch).

The FC6 did simply set-up a USB serial communication with the PC, sending a counter-value every 1sec.

Solution : I must deconnect the USB-cable, then reset the PIC. The user-program is now starting to run (bootloader is skipped) then reconnect the USB-cable.
I have not the smallest idea why the usb-cable may not stay connected when resetting the PIC….

Post Reply