nfd / spi-flash-programmer

SPI flash programmer sketch and client library for Arduino
Creative Commons Zero v1.0 Universal
98 stars 26 forks source link

How to get this runningin windows #3

Open sriranjanr opened 7 years ago

sriranjanr commented 7 years ago

Hello,

I installed python 3 in windows and even pyserial. I checked pyserial to be working. Could you tell me how to modify the code to get it running in windows. What options do I need to give to make this code identify windows serial port.

How do I change this statement to make it work in windows. python3 spi_flash_programmer_client.py -d /dev/cu.usbserial --flash-offset 0 -s 4096 -f dump.bin read

And how do I change this here: def init(self, filename): self.sock = serial.Serial(filename, 115200, timeout=1)

instead of filename should I put 'COM5'? Let me know.

sriranjanr commented 7 years ago

Was able to read and write from the flash chip in windows.But the new firmware I want to write is just 512kb. I set the offset to 512 in the command line arguments but writing fails. Any idea why is this happening?

flash write error

sriranjanr commented 7 years ago

I checked the dump read from the IC (my chip is FM25F04) it is just blank. Could you tell me why this is happening?I am using a Teensy instead of arduino 328. Your program compiles fine on the teensy.

mtokeyboard commented 6 years ago

hi there !

i have installed pyserial , and i am having issue with the client usage. it gives invalid syntax error

iam using the same syntax as yours. !!

mtokeyboard commented 6 years ago

I am also not able to upload sketch to arduino UNO ! it gives error !

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

spi_flash_programmer:21: error: 'prog_uint32_t' does not name a type

static const PROGMEM prog_uint32_t crc_table[16] = {

                  ^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,

             from sketch\spi_flash_programmer.ino.cpp:1:

C:\Users\a\Downloads\spi-flash-programmer-master\spi-flash-programmer-master\spi_flash_programmer\spi_flash_programmer.ino: In function 'long unsigned int crc_update(long unsigned int, byte)':

spi_flash_programmer:32: error: 'crc_table' was not declared in this scope

 crc = pgm_read_dword_near(crc_table + (tbl_idx & 0x0f)) ^ (crc >> 4);

                           ^

spi_flash_programmer:34: error: 'crc_table' was not declared in this scope

 crc = pgm_read_dword_near(crc_table + (tbl_idx & 0x0f)) ^ (crc >> 4);

                           ^

C:\Users\a\Downloads\spi-flash-programmer-master\spi-flash-programmer-master\spi_flash_programmer\spi_flash_programmer.ino: In function 'void loop()':

spi_flash_programmer:87: error: 'erase_all' was not declared in this scope

 erase_all();

           ^

spi_flash_programmer:92: error: 'read_page' was not declared in this scope

 read_page(addr1, addr2);

                       ^

spi_flash_programmer:97: error: 'write_page' was not declared in this scope

 write_page(addr1, addr2);

                        ^

spi_flash_programmer:111: error: 'erase_sector' was not declared in this scope

 erase_sector(addr1, addr2);

                          ^

exit status 1 'prog_uint32_t' does not name a type

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.