I am trying to program the PIC18F25K80, and I always get the same error: "no answer ERROR: problem in writing flash memory!!!"
I'm just trying to put a digital pin to a high value, so the HEX file is quite short.
At first I got the error of "HEX file too large", then I loocked for info at the forum and I found that I must change the ROM memory range, but honestly, I'm not sure what value should I put on it. Now I'm using "default,-F90-FFF".
I'm using the XC8 Compiler and the messages at the bootloader software is:
Check Device...
Open COM17 serial port at 19200bd
Hardware RTS reseting Device
Device answer: 0x6C 0x43='C'
byte OK, now check ID-code and Family...
idCode = $6C
family = C
description = 18F w/32KB flash & 1024B EEPROM
flash mem = 32768 bytes
EEPROM mem = 1024 bytes
Bootloader size = 200 bytes
Transfert block size = 64 bytes
Found: 18F w/32KB flash & 1024B EEPROM
Open HEX file: C:\Users\irg076\MPLABXProjects\test.X\dist\default\production\test.X.production.hex
:04000000C1EF07F055
0x0000: C1 EF 07 F0
:0E0F82000001C4EF07F0949C8B8C00EF00F090
0x0F82: 00 01 C4 EF 07 F0 94 9C 8B 8C 00 EF 00 F0
minMemPos=00000000, maxMemPos=00007F40, blockSize=64
first 4 words at address 0x7F38:
0xEFC1
0xF007
0xFFFF
0xFFFF
Transferring flash...
Transferring program memory...
write mem pos: 0x00000000(byte)
send: TBLPTRU=0x00, TBLPTRH=0x00, TBLPTRL=0x00, block=64
A0 EF 3F F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
no answer
ERROR: problem in writing flash memory!!!
Close COM17 serial port
3) The first problem that I had was that the hex file was too large so the bootloader was going to be rewrite, so I looked at the forum to check if someone else have had this same problem and I found out that I had to change the range of memory.
The point here is that I'm not sure if that is the right range value that I should put on it.
4) Also, at the .asm file I have the following line of code:
IntrareBootloader:
;skip TRIS to 0 C6
bsf OSCCON,IRCF0 ;int clock 16MHz
And at the datasheet, I have that in order to have 16MHz of internal clock frecuency, all three IRCF bits should be set. Therefore I tried to change it as follows:
I configurate the ROM Ranges as you explain in the link of tested compilers. Following the instructions there, I configurated the range as 0-7F37 (0 - (MAX MEMORY: 7FFF - BOOTLOADER MEMORY: C8)).
At first it worked fine, but then I changed a little bit the code and the same error appeared again... Honestly, I didn't do anything wrong! And now, I tried the same code that worked a week ago, and the same error appeared also...
I don't really know what can I do next... in the MPLABX, when I compile, I can see the mapping of the HEX File, maybe it can help you to see what is wrong:
HEX File Usage Map:
Legend:
- = Unused memory
F = Filled ROM
S = Stored serial code
A = Stored ASCII string
R = Reserved for checksum
C = Stored checksum result
T = Trailing code
& = Find & replace opcode
X = Find & delete opcode
1 = dist/default/production/UART_PROG.X.production.hex
00000000: 1111------------------------------------------------------------
00007F00: ------------------------------------------11111111111111--------
00200000: 11111111--------------------------------------------------------
00300000: 11111111111111--------------------------------------------------
As I told you, it worked fine just a week ago, I tried the digital pin output, and the UART module, and everything was ok! Then I tried the ADC Module, and nothing works since then...
Also, I'm using a Macbook PRO with the console and the "mono" command to open the .EXE of tinyMultiBootloader. Do you think it might be a problem?
When I write to you is because I did everything I could, I hope it doesn't bother you. I am using your bootloader for my final thesis in the university, and I really need to do it...
Thank you very much!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to program the PIC18F25K80, and I always get the same error: "no answer ERROR: problem in writing flash memory!!!"
I'm just trying to put a digital pin to a high value, so the HEX file is quite short.
At first I got the error of "HEX file too large", then I loocked for info at the forum and I found that I must change the ROM memory range, but honestly, I'm not sure what value should I put on it. Now I'm using "default,-F90-FFF".
I'm using the XC8 Compiler and the messages at the bootloader software is:
Check Device...
Open COM17 serial port at 19200bd
Hardware RTS reseting Device
Device answer: 0x6C 0x43='C'
byte OK, now check ID-code and Family...
idCode = $6C
family = C
description = 18F w/32KB flash & 1024B EEPROM
flash mem = 32768 bytes
EEPROM mem = 1024 bytes
Bootloader size = 200 bytes
Transfert block size = 64 bytes
Found: 18F w/32KB flash & 1024B EEPROM
Open HEX file: C:\Users\irg076\MPLABXProjects\test.X\dist\default\production\test.X.production.hex
:04000000C1EF07F055
0x0000: C1 EF 07 F0
:0E0F82000001C4EF07F0949C8B8C00EF00F090
0x0F82: 00 01 C4 EF 07 F0 94 9C 8B 8C 00 EF 00 F0
minMemPos=00000000, maxMemPos=00007F40, blockSize=64
first 4 words at address 0x7F38:
0xEFC1
0xF007
0xFFFF
0xFFFF
Transferring flash...
Transferring program memory...
write mem pos: 0x00000000(byte)
send: TBLPTRU=0x00, TBLPTRH=0x00, TBLPTRL=0x00, block=64
A0 EF 3F F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
no answer
ERROR: problem in writing flash memory!!!
Close COM17 serial port
THE HEX FILE IS:
:04000000C1EF07F055
:0E0F82000001C4EF07F0949C8B8C00EF00F090
:00000001FF
I hope you can help me. Thank you very much!
Hi,Iker
①This firmware has a proven track record in 18F46K80.
https://sourceforge.net/p/tinypicbootload/discussion/help/thread/264d28de/
②Do you use the following sources ?
Dan_tinybld18F25K80-45K80-65K80-26K80-46K80-66K80_int16MHz_19200_r2.asm
③What does this mean?
Now I'm using "default,-F90-FFF"
Best regards,
Dan
Hello Dan,
First of all, thank you very much for answering.
2) I use the following source:
tinybld18F25K80_int16MHz_19200.asm
But I will flash your file asap and check it!
3) The first problem that I had was that the hex file was too large so the bootloader was going to be rewrite, so I looked at the forum to check if someone else have had this same problem and I found out that I had to change the range of memory.
More more precisely, I changed the range at:
Project Properties/XC8 Linker/Memory Model/ROM ranges -> "default,-F90-FFF"
The point here is that I'm not sure if that is the right range value that I should put on it.
4) Also, at the .asm file I have the following line of code:
And at the datasheet, I have that in order to have 16MHz of internal clock frecuency, all three IRCF bits should be set. Therefore I tried to change it as follows:
After that, I had the bootloader working for the first time. And then, I had the problem with the "ERROR: No answer".
So, do you think that maybe I "broke" the code by changing those lines?
Thank you very much, Dan.
Last edit: Iker Ramírez Gorostizaga 2016-05-24
Hi,Iker
TMBL+ unlike Microchip's bootloader, You create a user program from 0x0000.
Do not work with the following settings?
Codeoffset : 0x0000
ROM ranges : default,-7F40-7FFF
reference
http://tinypicbootload.sourceforge.net/tested_compilers_pic.html
Best regards,
Dan
Hello Dan,
I configurate the ROM Ranges as you explain in the link of tested compilers. Following the instructions there, I configurated the range as 0-7F37 (0 - (MAX MEMORY: 7FFF - BOOTLOADER MEMORY: C8)).
At first it worked fine, but then I changed a little bit the code and the same error appeared again... Honestly, I didn't do anything wrong! And now, I tried the same code that worked a week ago, and the same error appeared also...
I don't really know what can I do next... in the MPLABX, when I compile, I can see the mapping of the HEX File, maybe it can help you to see what is wrong:
HEX File Usage Map:
Legend:
- = Unused memory
F = Filled ROM
S = Stored serial code
A = Stored ASCII string
R = Reserved for checksum
C = Stored checksum result
T = Trailing code
& = Find & replace opcode
X = Find & delete opcode
1 = dist/default/production/UART_PROG.X.production.hex
00000000: 1111------------------------------------------------------------
00007F00: ------------------------------------------11111111111111--------
00200000: 11111111--------------------------------------------------------
00300000: 11111111111111--------------------------------------------------
As I told you, it worked fine just a week ago, I tried the digital pin output, and the UART module, and everything was ok! Then I tried the ADC Module, and nothing works since then...
Also, I'm using a Macbook PRO with the console and the "mono" command to open the .EXE of tinyMultiBootloader. Do you think it might be a problem?
When I write to you is because I did everything I could, I hope it doesn't bother you. I am using your bootloader for my final thesis in the university, and I really need to do it...
Thank you very much!
Hi,Iker
Thank you very much for the test results.
First, the range selection that I presented was a mistake.
Correct parameters are as follows.
ROM ranges : default,-7F38-7FFF
!!! Other checkpoints !!!
Please check the assembler code to compile the results of XC8.
①0000 or 0002 correctly jump code in the address, make sure that has been generated.
This jump code is not a jump code to the boot loader.
Is a jump code for user program to work properly in a stand-alone.
Correct generation pattern of jump codes. Described on the following pages.
http://tinypicbootload.sourceforge.net/tested_compilers_pic.html
②Interrupt routine is generated in a given address?
③Code does not exist in later 0x7F38?
Best regards,
Dan