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
Code Offset bug ?
Moderator: Benj
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Code Offset bug ?
- Attachments
-
- USBSerial.hex
- Linked with the -rb 0x1000 directive.
- (11.64 KiB) Downloaded 224 times
-
- 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 ?
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
― C.S. Lewis
- 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 ?
Yes I agree with Leigh, All memory locations before address 0x1000 are NOPs.
I used MPLAB to get this program memory listing from your hex file.
I used MPLAB to get this program memory listing from your hex file.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Re: Code Offset bug ?
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….
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….