diff --git a/compiled/Mega2560-optiboot/firmware.bin b/compiled/Mega2560-optiboot/firmware.bin index 95c84f4..b5f69b0 100755 Binary files a/compiled/Mega2560-optiboot/firmware.bin and b/compiled/Mega2560-optiboot/firmware.bin differ diff --git a/compiled/Mega2560-optiboot/firmware.elf b/compiled/Mega2560-optiboot/firmware.elf new file mode 100644 index 0000000..05bb765 Binary files /dev/null and b/compiled/Mega2560-optiboot/firmware.elf differ diff --git a/compiled/lighthub21/firmware.bin b/compiled/lighthub21/firmware.bin index 592f0af..c8f4a87 100644 Binary files a/compiled/lighthub21/firmware.bin and b/compiled/lighthub21/firmware.bin differ diff --git a/compiled/lighthub21/upload.bat b/compiled/lighthub21/upload.bat index e55fb85..bdc64ae 100644 --- a/compiled/lighthub21/upload.bat +++ b/compiled/lighthub21/upload.bat @@ -59,8 +59,8 @@ PING -n %WAIT_ERASED% 127.0.0.1>NUL REM Execute bossac.exe ECHO Execute bossac with command line: -ECHO "%BOSSACPATH%" -i -d --port=%COMPORT% -U false -e -w -v -b "%BINFILE%" -R -START /WAIT "" "%BOSSACPATH%" -i --port=%COMPORT% -U false -e -w -v -b "%BINFILE%" -R +"%BOSSACPATH%" -i --port=%COMPORT% -U false -e -u -w -v -b "%BINFILE%" -R +REM START /WAIT "" "%BOSSACPATH%" -i --port=%COMPORT% -U false -e -w -v -b "%BINFILE%" -R GOTO end diff --git a/compiled/lighthub21/uploadNative.bat b/compiled/lighthub21/uploadNative.bat new file mode 100644 index 0000000..def9a70 --- /dev/null +++ b/compiled/lighthub21/uploadNative.bat @@ -0,0 +1,91 @@ +@ECHO off + +REM Wait X second for memory on Arduino Due is erased. +SET WAIT_ERASED=4 + +ECHO ------ External tool BossacArduinoDue started ------ + +REM number of command line arguments ok? +REM IF [%1]==[] GOTO error_args +REM IF [%2]==[] GOTO error_args + +REM set command line arguments +SET BOSSACPATH=..\tools\win\tool-bossac\bossac.exe +SET BINFILE=firmware.bin + +REM parse command line arguments +SET BOSSACPATH=%BOSSACPATH:"=% +SET BINFILE=%BINFILE:"=% + +REM workeround for bug in Atmel Studio 6.0.1996 Service Pack 2 +SET BINFILE=%BINFILE:\\=\% +SET BINFILE=%BINFILE:.cproj=% + +REM bossac path exist? +IF NOT EXIST "%BOSSACPATH%" GOTO error_arg1 + +REM bin file exist? +IF NOT EXIST "%BINFILE%" GOTO error_binfile + +REM fetch DeviceID of Arduino Due Programming Port from WMI Service +FOR /f "tokens=* skip=1" %%a IN ('wmic PATH Win32_SerialPort Where "Caption LIKE '%%BOSSA%%'" get DeviceID') DO ( + SET COMX=%%a + GOTO exit1 +) + +REM Arduino Due Programming Port not exist +GOTO error_comport + +:exit1 + +REM remove blank +SET COMPORT=%COMX: =% + +REM report in Atmel Studio 6.0 IDE output window +ECHO BossacPath=%BOSSACPATH% +ECHO BinFile=%BINFILE% +ECHO Arduino Due Programming Port is detected as %COMPORT%. + +REM The bossac bootloader only runs if the memory on Arduino Due is erased. +REM The Arduino IDE does this by opening and closing the COM port at 1200 baud. +REM This causes the Due to execute a soft erase command. +ECHO Forcing reset using 1200bps open/close on port +ECHO MODE %COMPORT%:1200,N,8,1 +MODE %COMPORT%:1200,N,8,1 + +REM Wait X second for memory on Arduino Due is erased. +ECHO Wait for memory on Arduino Due is erased... +PING -n %WAIT_ERASED% 127.0.0.1>NUL + +REM Execute bossac.exe +ECHO Execute bossac with command line: + +"%BOSSACPATH%" -i --port=%COMPORT% -u -e -w -v -b "%BINFILE%" -R +REM START /WAIT "" "%BOSSACPATH%" -i --port=%COMPORT% -u -e -w -v -b "%BINFILE%" -R + +GOTO end + +:error_args +ECHO Error: wrong number of command line arguments passed! +GOTO end + +:error_arg1 +ECHO Error: command line argument 1 - path to bossac.exe not exist! - "C:\Program Files (x86)\arduino-1.5.2\hardware\tools\bossac.exe" +ECHO Error: command line argument 1 - argument passed = %1 +GOTO end + +:error_arg2 +ECHO Error: command line argument 2 - path to bin file not exist! - use $(OutputDirectory)\$(OutputFileName).bin +ECHO Error: command line argument 2 - argument passed = %1 +GOTO end + +:error_binfile +ECHO Error: bin file "%BINFILE%" not exist! +GOTO end + +:error_comport +ECHO Error: Arduino Due Programming Port not found! + +:end + +ECHO ======================== Done ======================== \ No newline at end of file diff --git a/docs/html/search/firmware.bin b/docs/html/search/firmware.bin new file mode 100644 index 0000000..fd406eb Binary files /dev/null and b/docs/html/search/firmware.bin differ diff --git a/lighthub/flashstream.cpp b/lighthub/flashstream.cpp index a3e5276..00b19f4 100644 --- a/lighthub/flashstream.cpp +++ b/lighthub/flashstream.cpp @@ -248,7 +248,7 @@ NRFFlashStorage EEPROM; return 1; #endif }; - + /* #if defined(__SAM3X8E__) size_t flashStream::write(const uint8_t *buffer, size_t size) { @@ -258,7 +258,7 @@ NRFFlashStorage EEPROM; }; #endif - +*/ #if defined(ESP8266) || defined(ESP32) void flashStream::putEOF() { @@ -269,7 +269,11 @@ NRFFlashStorage EEPROM; void flashStream::close() { - if (openmode == 'w') putEOF(); + if (openmode == 'w') + { + putEOF(); + debugSerial<> #ifndef HSV_DISABLE #ifdef ADAFRUIT_LED @@ -1170,7 +1171,7 @@ return false; int cmd = txt2cmd(verb->valuestring); if (cmd>0) { - free(verb->valuestring); + freeString(verb->valuestring); verb->valueint=cmd; verb->type=aJson_Int; return verb->valueint; diff --git a/lighthub/main.cpp b/lighthub/main.cpp index a6bd161..ba7f929 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -1510,6 +1510,7 @@ int loadConfigFromEEPROM() #endif if (sysConfStream.peek() == '{') { + debugSerial<begin(9600); item->itemArr->subtype = CST_INITIALIZED;