Salamek / picpro

PIC K150 programmer software written in Python 3
GNU General Public License v2.0
11 stars 2 forks source link

Programming 16f690 Issue #8

Open Davud2020 opened 11 months ago

Davud2020 commented 11 months ago

Hi Why do we get this error under Ubuntu 12?

$ sudo apt install python3-picpro
$ picpro program -p /dev/ttyUSB0 -i ~/blabla.hex -t 16F690 --icsp
Accessing chip connected to ICSP port.
Chip config: {'chip_id': 5126, 'id': b'\x0f\x0f\x0f\x0f\xff\xff\xff\xff', 'fuses': [16133, 9274, 16383, 65535, 65535, 65535, 65535], 'calibrate': 0}
Erasing Chip
Programming ROM
Traceback (most recent call last):
  File "/usr/bin/picpro", line 33, in <module>
    sys.exit(load_entry_point('picpro==0.0.13', 'console_scripts', 'picpro')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picpro/bin/picpro.py", line 480, in main
    getattr(command, 'chosen')()  # Execute the function specified by the user.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picpro/bin/picpro.py", line 102, in program
    program_pic(
  File "/usr/lib/python3/dist-packages/picpro/bin/picpro.py", line 421, in program_pic
    if not protocol_interface.program_rom(rom_data):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picpro/ProtocolInterface.py", line 215, in program_rom
    raise InvalidValueError('Data too large for PIC ROM')
picpro.exceptions.InvalidValueError: Data too large for PIC ROM

$ sudo picpro program -p /dev/ttyUSB0 -i ~/blabla.hex -t 16F690 --icsp
Accessing chip connected to ICSP port.
Chip config: {'chip_id': 5126, 'id': b'\xff\xff\xff\xff\xff\xff\xff\xff', 'fuses': [16383, 9274, 16383, 65535, 65535, 65535, 65535], 'calibrate': 16383}
Erasing Chip
Programming ROM
Traceback (most recent call last):
  File "/usr/bin/picpro", line 33, in <module>
    sys.exit(load_entry_point('picpro==0.0.13', 'console_scripts', 'picpro')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picpro/bin/picpro.py", line 480, in main
    getattr(command, 'chosen')()  # Execute the function specified by the user.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picpro/bin/picpro.py", line 102, in program
    program_pic(
  File "/usr/lib/python3/dist-packages/picpro/bin/picpro.py", line 421, in program_pic
    if not protocol_interface.program_rom(rom_data):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picpro/ProtocolInterface.py", line 215, in program_rom
    raise InvalidValueError('Data too large for PIC ROM')
picpro.exceptions.InvalidValueError: Data too large for PIC ROM
Salamek commented 11 months ago

I would guess because your ROM file is bigger then actual ROM size as a message said?

16f690 ROM size is 4096 words (8192 bytes) what is size of your ROM you are trying to flash?

Davud2020 commented 11 months ago

Actually it works under windows with K150 programmer board.But in Ubuntu I get this issue.How do we set blank the chip? Thank you.

Salamek commented 11 months ago

If it works under official SW, can you provide your blabla.hex (if it is not some super secret) for me to debug what is going on...

Also you want to know how to erase the chip?

Davud2020 commented 11 months ago

esr-3.zip yes I would like to know that too if you mind.

Salamek commented 11 months ago

erase is added in version 0.1

picpro erase -p /dev/ttyUSB0 -t 16F690 --icsp
Davud2020 commented 11 months ago

What was the issue?

Davud2020 commented 10 months ago

Hi again Happy new Year!!!

Now this error Are we able to check picpro version?

$ picpro program -p /dev/ttyUSB0 -i esr_cap.hex -t 16f690 --icsp         
Accessing chip connected to ICSP port.
Chip config: {'chip_id': 5126, 'id': b'\xff\xff\xff\xff\xff\xff\xff\xff', 'fuses': [16134, 9274, 16383, 65535, 65535, 65535, 65535], 'calibrate': 0}
Erasing Chip
Programming ROM
Programming EEPROM
Programming ID and fuses
Verifying ROM
ROM verification failed.
Maybe ROM is locked for reading?
Verifying EEPROM
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff') (256)
EEPROM verification failed.
Davud2020 commented 10 months ago

I'm able to flash with Pickit 2 every version of esr_cap

$ sudo pk2cmd -P PIC16F690 -X -M -F esr_cap_3.hex
PICkit 2 Program Report
2-1-2024, 16:04:31
Device Type: PIC16F690

Program Succeeded.

Operation Succeeded

$ sudo pk2cmd -P PIC16F690 -X -M -F esr_cap_3_1sec_int.hex 
PICkit 2 Program Report
2-1-2024, 16:06:25
Device Type: PIC16F690

Program Succeeded.

Operation Succeeded

$ sudo pk2cmd -P PIC16F690 -X -M -F esr_cap.hex 
PICkit 2 Program Report
2-1-2024, 16:07:10
Device Type: PIC16F690

Program Succeeded.

Operation Succeeded
Davud2020 commented 10 months ago

Sorry I just accidentally close the issue.

Davud2020 commented 10 months ago

$ picpro dump rom -p /dev/ttyUSB0 -o PIC16F877_887.hex -t 16f877 Waiting for user to insert chip into socket with pin 1 at socket pin 1 Chip detected. Reading ROM into file PIC16F877_887.hex... Traceback (most recent call last): File "/home/whynot/.local/bin/picpro", line 8, in sys.exit(main()) ^^^^^^ File "/home/whynot/.local/lib/python3.11/site-packages/picpro/bin/picpro.py", line 499, in main getattr(command, 'chosen')() # Execute the function specified by the user. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/whynot/.local/lib/python3.11/site-packages/picpro/bin/picpro.py", line 147, in dump content = swab_bytes(protocol_interface.read_rom()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/whynot/.local/lib/python3.11/site-packages/picpro/ProtocolInterface.py", line 362, in read_rom self._command_end() File "/home/whynot/.local/lib/python3.11/site-packages/picpro/ProtocolInterface.py", line 120, in _command_end raise InvalidResponseError('Unexpected response ("{!r}") in command end.'.format(ack)) picpro.exceptions.InvalidResponseError: Unexpected response ("b'?'") in command end.