                 partition = atoi(partition_cp);
             }
             writingToFlash = true;
-            flashLinesWritten = 0;
+            hexLinesWritten = 0;
             maxim.startWritingToFlashMemory(partition);
             Serial.println("Writing to flash memory...");
         }

}

void setup() {
    // initialize serial:
    Serial.begin(115200);
    printIden();
    // reserve 200 bytes for the inputString:
    inputString.reserve(200);

//    maxim.setPins(11,12,13); // only for software SPI
    maxim.begin();
}

/*
SerialEvent occurs whenever a new data comes in the
hardware serial RX.  This routine is run between each
time loop() runs, so using delay inside loop can delay
response.  Multiple bytes of data may be available.
*/
void serialEvent() {
    while (Serial.available()) {
        // get the new byte:
        char inChar = (char)Serial.read();
        // if the incoming character is a newline, set a flag
        // so the main loop can do something about it:
        if (inChar == '\n') {
            stringComplete = true;
        }
        else {
            // add it to the inputString:
            inputString += inChar;
        }
    }
}

void writeToFlashMemory() {

}

void loop() {

            }
            else {
                Serial.print(".");
                hexLinesWritten++;
                if(hexLinesWritten>80) {
                    hexLinesWritten = 0;
                    Serial.println();
                }
                if(maxim.hasEOFBeenReached()) {
