From 72f24c09deb7bed42a976b12ca68aa95b64b0930 Mon Sep 17 00:00:00 2001 From: JW-Control Date: Wed, 15 Jul 2026 12:46:57 -0500 Subject: [PATCH 1/6] fix(fram): habilitar escritura independiente para header y payload --- libraries/JW_FRAM/src/JW_FRAM.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/libraries/JW_FRAM/src/JW_FRAM.h b/libraries/JW_FRAM/src/JW_FRAM.h index 5e9ec43..a93aa61 100644 --- a/libraries/JW_FRAM/src/JW_FRAM.h +++ b/libraries/JW_FRAM/src/JW_FRAM.h @@ -213,21 +213,14 @@ bool JW_FRAM::writeBlock(uint32_t addr, const T &value, uint8_t version) header.length = static_cast(sizeof(T)); header.checksum = computeChecksum(reinterpret_cast(&value), sizeof(T)); - if (!writeEnable(true)) - { - debugPrint(F("JW_FRAM::writeBlock() fallo al habilitar escritura")); - return false; - } - - bool ok = write(addr, reinterpret_cast(&header), sizeof(header)); + // Header y payload se envían como dos comandos WRITE independientes. + // Cada WRITE usa put() para ejecutar su propio ciclo WREN -> WRITE -> WRDI. + // Esto evita perder el payload en dispositivos que limpian WEL al terminar + // la primera transacción de escritura. + bool ok = put(addr, header); if (ok) { - ok = write(addr + sizeof(header), reinterpret_cast(&value), sizeof(T)); - } - - if (!writeEnable(false)) - { - debugPrint(F("JW_FRAM::writeBlock() fallo al deshabilitar escritura")); + ok = put(addr + sizeof(header), value); } if (!ok) @@ -296,4 +289,4 @@ bool JW_FRAM::readBlock(uint32_t addr, T &value, uint8_t expectedVersion) return true; } -#endif +#endif \ No newline at end of file From 177459cd7b3ca589cd2863837cd17973d4ba272e Mon Sep 17 00:00:00 2001 From: JW-Control Date: Wed, 15 Jul 2026 12:47:05 -0500 Subject: [PATCH 2/6] =?UTF-8?q?chore(fram):=20actualizar=20versi=C3=B3n=20?= =?UTF-8?q?a=201.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/JW_FRAM/library.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/JW_FRAM/library.properties b/libraries/JW_FRAM/library.properties index f4e63a2..7f74d6b 100644 --- a/libraries/JW_FRAM/library.properties +++ b/libraries/JW_FRAM/library.properties @@ -1,5 +1,5 @@ name=JW_FRAM -version=1.0.2 +version=1.0.3 author=JW Control maintainer=JW Control sentence=Libreria SPI FRAM con API estilo EEPROM para ESP32. @@ -7,4 +7,4 @@ paragraph=Incluye acceso de bajo nivel y alto nivel para FRAM SPI, con soporte p category=Data Storage url=https://github.com/JW-Control/JW_FRAM architectures=esp32 -depends=Adafruit BusIO +depends=Adafruit BusIO \ No newline at end of file From c4d470dd83934570bc24672af4794642cc8d648d Mon Sep 17 00:00:00 2001 From: JW-Control Date: Wed, 15 Jul 2026 12:47:17 -0500 Subject: [PATCH 3/6] =?UTF-8?q?docs(fram):=20registrar=20correcci=C3=B3n?= =?UTF-8?q?=20de=20writeBlock=20en=201.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/JW_FRAM/CHANGELOG.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/JW_FRAM/CHANGELOG.md b/libraries/JW_FRAM/CHANGELOG.md index 294311d..71c7f39 100644 --- a/libraries/JW_FRAM/CHANGELOG.md +++ b/libraries/JW_FRAM/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.0.3] - 2026-07-15 + +### Corregido +- `writeBlock()` ahora habilita la escritura de forma independiente para el encabezado y el payload. +- Se evita que el payload quede sin escribir en memorias que limpian el latch WEL al finalizar cada comando `WRITE`. +- La lectura posterior mediante `readBlock()` vuelve a validar correctamente `magic`, versión, longitud y checksum. + +### Notas +- `get()`, `put()` y `update()` no estaban afectados porque cada operación `put()` ya ejecutaba su propio ciclo `WREN -> WRITE -> WRDI`. +- La corrección mantiene la API pública y el formato almacenado sin cambios. + ## [1.0.2] - 2026-04-24 ### Added @@ -14,7 +25,6 @@ ### Notes - This version improves compatibility with JWPLC hardware families using shared SPI peripherals such as TFT, FRAM, microSD and Ethernet. - ## [1.0.1] - 2026-04-03 ### Añadido - Estructura completa de librería compatible con el ecosistema Arduino. @@ -28,4 +38,4 @@ ## [1.0.0] - 2026-04-03 ### Inicial -- Primera propuesta funcional de JW_FRAM. +- Primera propuesta funcional de JW_FRAM. \ No newline at end of file From a354e5bc9d04e677455f0fa0000c66858b4bab1d Mon Sep 17 00:00:00 2001 From: JW-Control Date: Wed, 15 Jul 2026 12:47:41 -0500 Subject: [PATCH 4/6] docs(fram): documentar writeBlock corregido en 1.0.3 --- libraries/JW_FRAM/README.md | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/libraries/JW_FRAM/README.md b/libraries/JW_FRAM/README.md index 6d7a7c5..f8aa5e8 100644 --- a/libraries/JW_FRAM/README.md +++ b/libraries/JW_FRAM/README.md @@ -225,6 +225,8 @@ Esto sirve para detectar: - corrupción de datos - tamaños de payload incorrectos +Desde `JW_FRAM 1.0.3`, `writeBlock()` ejecuta una habilitación de escritura independiente para el header y otra para el payload. Esto mantiene compatibilidad con memorias que limpian el latch WEL al finalizar cada comando `WRITE`. + ### Ejemplo ```cpp @@ -259,37 +261,10 @@ fram.disableDebug(); Eso evita amarrar la librería exclusivamente a `Serial`. -## Dispositivos no soportados en la tabla interna - -Si la librería no reconoce el `Device ID`, puedes forzar manualmente el tamaño al iniciar: +## Estado de la versión bundled -```cpp -fram.begin(8 * 1024); +```text +JW_FRAM 1.0.3 ``` -Eso permite trabajar con memorias FRAM compatibles aunque no estén todavía incluidas en la tabla interna. - -## Estructura recomendada de la librería - -La librería ya fue preparada con archivos compatibles con el ecosistema Arduino: - -- `src/` -- `examples/` -- `library.properties` -- `README.md` -- `CHANGELOG.md` -- `keywords.txt` -- `LICENCE` - -## Ideas futuras - -Para versiones posteriores podrían añadirse: - -- CRC16 en lugar de checksum simple -- funciones `fill()` o `clear()` -- más modelos en la tabla de dispositivos -- más ejemplos de uso orientados a productos JWPLC - -## Nota de licencia - -La base original de Adafruit usa licencia BSD. Si esta librería deriva de ese trabajo, se debe conservar la atribución correspondiente y mantener el texto de licencia apropiado. El repositorio de Adafruit FRAM SPI publica su licencia BSD con cláusula de atribución y limitación de responsabilidad. citeturn948721view0 +Corrección principal: escritura validada de bloques compatible con la FM25CL64B usada por JWPLC Basic. \ No newline at end of file From da58c1ec0e9c010997107ab1e69486644c1d51cf Mon Sep 17 00:00:00 2001 From: JW-Control Date: Wed, 15 Jul 2026 12:48:22 -0500 Subject: [PATCH 5/6] =?UTF-8?q?docs(fram):=20conservar=20documentaci=C3=B3?= =?UTF-8?q?n=20completa=20y=20a=C3=B1adir=20nota=201.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/JW_FRAM/README.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/libraries/JW_FRAM/README.md b/libraries/JW_FRAM/README.md index f8aa5e8..4e0d27f 100644 --- a/libraries/JW_FRAM/README.md +++ b/libraries/JW_FRAM/README.md @@ -261,10 +261,36 @@ fram.disableDebug(); Eso evita amarrar la librería exclusivamente a `Serial`. -## Estado de la versión bundled +## Dispositivos no soportados en la tabla interna -```text -JW_FRAM 1.0.3 +Si la librería no reconoce el `Device ID`, puedes forzar manualmente el tamaño al iniciar: + +```cpp +fram.begin(8 * 1024); ``` -Corrección principal: escritura validada de bloques compatible con la FM25CL64B usada por JWPLC Basic. \ No newline at end of file +Eso permite trabajar con memorias FRAM compatibles aunque no estén todavía incluidas en la tabla interna. + +## Estructura recomendada de la librería + +La librería ya fue preparada con archivos compatibles con el ecosistema Arduino: +- `src/` +- `examples/` +- `library.properties` +- `README.md` +- `CHANGELOG.md` +- `keywords.txt` +- `LICENCE` + +## Ideas futuras + +Para versiones posteriores podrían añadirse: + +- CRC16 en lugar de checksum simple +- funciones `fill()` o `clear()` +- más modelos en la tabla de dispositivos +- más ejemplos de uso orientados a productos JWPLC + +## Nota de licencia + +La base original de Adafruit usa licencia BSD. Si esta librería deriva de ese trabajo, se debe conservar la atribución correspondiente y mantener el texto de licencia apropiado. El repositorio de Adafruit FRAM SPI publica su licencia BSD con cláusula de atribución y limitación de responsabilidad. \ No newline at end of file From 7aa8d49d5a8609449ee935444a9fe7dd36ea0ee0 Mon Sep 17 00:00:00 2001 From: JW-Control Date: Wed, 15 Jul 2026 12:50:24 -0500 Subject: [PATCH 6/6] =?UTF-8?q?chore(sync):=20apuntar=20librer=C3=ADas=20a?= =?UTF-8?q?l=20package=202.1.0=20actual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform-jwplc-sync.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform-jwplc-sync.properties b/platform-jwplc-sync.properties index fb6929a..0eb921f 100644 --- a/platform-jwplc-sync.properties +++ b/platform-jwplc-sync.properties @@ -2,13 +2,13 @@ PLATFORM_REPO=JW-Control/platform-jwplc # Rama base hacia donde irá el PR -PLATFORM_BASE_BRANCH=develop/alpha31-release-readiness +PLATFORM_BASE_BRANCH=main # Rama generada/actualizada por el workflow -PLATFORM_SYNC_BRANCH=sync/jw-libraries-alpha31 +PLATFORM_SYNC_BRANCH=sync/jw-libraries-2.1.0 # Carpeta destino dentro de platform-jwplc -PLATFORM_LIBRARIES_PATH=JWPLC/JWPLC-2.0.0/libraries +PLATFORM_LIBRARIES_PATH=JWPLC/2.1.0/libraries # Librerías que se copiarán desde JW-Libraries/libraries/ LIBRARIES="JW_MatrixButtons JW_FRAM JW_RTC JW_SD" \ No newline at end of file