mrWheel / KIM_TapeDevice

A solid state tape device for the (micro)KIM-1
12 stars 0 forks source link

compiling error in digitalTapeRecorder.ino #4

Open MarkusPlehn opened 5 days ago

MarkusPlehn commented 5 days ago

like the closed issue i want to come back to the compiling problem in digitalTapeRecorder.ino in this case: `243 //------------------------------------------------------ //-- reads a "nibble" (which is a char {0-9, A-F}) //-- returns //-- the nibble as a (ascii) char //------------------------------------------------------ char read1Nibble(File fIn) { while (true && fIn.available()) { char nibbleIn = fIn.read(); // skip ID lnibble if (isHex((char)nibbleIn)) { return nibbleIn; }

}

} // read1Nibble() ` must be a mistake, because there is no return value outer the "if" loop. my fix was a "return 0;" so compiling works, but this can´t be correct. I tryed Arduino IDE 1.81, 1.8.18 and 2.33 - compiling ends with error "exit status 1 control reaches end of non-void function [-Werror=return-type]"

What do you think ?

BTW: one time i could recording a file, but this file don´t work, because there is a "$20" after every single data-byte. And now every recording ends with an error : "ERROR!! $00F1 not '00'" but $00F1 is '00' ....

mrWheel commented 4 days ago

@MarkusPlehn , At the moment I’m extremely busy with family problems. As soon as I find some time I will compile in my AdruinoIDE and see what happens..

mrWheel commented 4 days ago

Just did a quick test.

Using ArduinoIDE 1.8.19 Esp8266 core 2.7.4

define _FW_VERSION "v2.0.2 WS (05-08-2021)"

I do not get any errors or warnings while compiling!

Executable segment sizes:
IROM   : 453992          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 28588   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1296  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 10076 ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 28608 )         - zeroed variables      (global, static) in RAM/HEAP 
Using library TelnetStream at version 1.2.2 in folder: /Users/WillemA/Documents/ArduinoProjects/libraries/TelnetStream 
Using library ESP8266WiFi at version 1.0 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi 
Using library ESP8266WebServer at version 1.0 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WebServer 
Using library ESP8266mDNS at version 1.2 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266mDNS 
Using library ModUpdateServer-master at version 1.0 in folder: /Users/WillemA/Documents/ArduinoProjects/libraries/ModUpdateServer-master 
Using library WiFiManager at version 2.0.10-beta in folder: /Users/WillemA/Documents/ArduinoProjects/libraries/WiFiManager 
Using library DNSServer at version 1.1.1 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/DNSServer 
Using library arduinoWebSockets-master at version 2.3.5 in folder: /Users/WillemA/Documents/ArduinoProjects/libraries/arduinoWebSockets-master 
Using library LittleFS at version 0.1.0 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/LittleFS 
Using library ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays at version 4.2.0 in folder: /Users/WillemA/Documents/ArduinoProjects/libraries/ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays 
Using library Wire at version 1.0 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/Wire 
Using library Hash at version 1.0 in folder: /Users/WillemA/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/Hash 
/Users/WillemA/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-size -A /Users/WillemA/tmp/arduinoBuild/digitalTapeRecorder.ino.elf
Sketch uses 493952 bytes (47%) of program storage space. Maximum is 1044464 bytes.
Global variables use 39980 bytes (48%) of dynamic memory, leaving 41940 bytes for local variables. Maximum is 81920 bytes.

This is the version I used for all the digitalTapeRecordes I have build and sold and they all work as expected (although the function "read1Nibble()" has no return value ...).

Screenshot 2024-11-22 at 10 23 14

MarkusPlehn commented 3 days ago

i have downgraded all my libraries and ArduinoIDE to your versions. Preferences are the same. Result:

compilingError

i don´t know, what´s happend

EDIT: i forgot to downgrade the ESP8266 core to 2.7.4 and now compiling succes !! So the ESP8266 core seems the problem ! with the actual core (3.1.2) don´t work !!

mrWheel commented 3 days ago

Ok. Glad it compiles without errors now. Does it read files?

Still there should be a return value after reading the file, so maybe add that after the while loop?

//------------------------------------------------------
//-- reads a "nibble" (which is a char {0-9, A-F})
//-- returns
//--    the nibble as a (ascii) char 
//------------------------------------------------------
char read1Nibble(File fIn) 
{
  while (true && fIn.available())
  {
    char nibbleIn = fIn.read();    // skip ID lnibble
    if (isHex((char)nibbleIn))
    {
       return nibbleIn;
    }
  } 
  return ‘0’; //— that is zero in single quotes

} // read1Nibble()

I need to say: I’m an incremental developer and it was a long time ago sinds I wrote this software. At this point in time I have no idea what the use of the read1Nibble() function is and why I coded it this way ….

MarkusPlehn commented 3 days ago

yes, reading files works, but it worked before too (with my "return 0;" workaround). But recording don´t work correct, just like before. The recording ends with ".. ERROR!! $00F1 not '00'", but $00F1 is set to'00' and the file length in /tmp "KIM.hex" is every time only 300 bytes long, no matter how many bytes i want to save. Lost sync with KIM-1 ?

The bytes are all correct, but it ends after 300 bytes (shown in FSExplorer): example: "Ping Pong" loaded to KIM-1 and then saved to DTR

00 00 02 0000 - 20 40 1F 20 6A 1F C9 13 D0 0A A2 08 BD 24 03 95 0020 - 80 CA 10 F8 C9 10 B0 22 AA 29 03 F0 04 C9 03 D0 0040 - 19 45 85 A8 29 04 D0 12 8A 45 84 29 02 F0 0B 98 0060 - 29 02 D0 69 8A 4A 4A 20 B1 02 20 40 1F D0 27 C6 0080 - 83 10 23 A5 80 85 83 18 A5 85 65 84 85 85 29 04 00

mrWheel commented 1 day ago

This is getting very frustrating!

1) Do you have configured the correct LittleFS size (Flash Size: 4MB (FS:3MB OTA:~512KB))

2) Have you tried flashing with the digitalTapeRecorder.ino.generic.bin file?
Use the FSexplorer to flash!

MarkusPlehn commented 1 day ago

This is getting very frustrating!

1. Do you have configured the correct LittleFS size (Flash Size:    `4MB (FS:3MB OTA:~512KB)`)

yes, configuration ls correct

2. Have you tried flashing with the `digitalTapeRecorder.ino.generic.bin` file? Use the FSexplorer to flash!

yes i tryed this, but i think it is prebuild for KIMmicro ?

i have checked the pulses with a logic analyzer and the pulses from DTR look completely different then those of KIM-1 . i'm amazed, that loading from DTR works TimingKIM-1_Recording TimingDTR-Play

EDIT: I think this mixed Arduino Versions and libraries in different version could be a problem. I will try to cleanup my PC and only install, what needed. Maybe the ATTiny fuses are incorrect and it works only with 1 MHz. tbc