knx icon indicating copy to clipboard operation
knx copied to clipboard

Added support for LibreTiny IoT chips

Open Phil1pp opened this issue 7 months ago • 5 comments

github.com/libretiny-eu/libretiny

Tested with CBU chip over WIFI

[env:BK7231N_ip]
platform = libretiny
board = cbu
framework = arduino
build_flags =
  -DMASK_VERSION=0x57B0
  -DSMALL_GROUPOBJECT
  -DKNX_NO_SPI
  -DKNX_FLASH_OFFSET=0x1DB000

Phil1pp avatar May 14 '25 09:05 Phil1pp

I don't understand why linking fails even though randomSeed is defined here: wiring_math.cpp

Phil1pp avatar May 14 '25 10:05 Phil1pp

Mabye millis() is unsigned long but the function needs uint32_t. Because there ist no function with parameter seed as unsigned long it cant link it.

If i make these changes in line 61 it works:

uint32_t seed = millis();
randomSeed(seed);

thewhobox avatar May 15 '25 10:05 thewhobox

Are you sure that this change should work? I wasn't able to compile it locally and also online it failed.

I only got it to compile by adding this:

#if defined(LIBRETINY)
#include "wiring_math.cpp"
#endif

Phil1pp avatar May 15 '25 19:05 Phil1pp

Strange. I tested it locally.

thewhobox avatar May 15 '25 19:05 thewhobox

I replaced randomSeed with srandom and now it works.

Phil1pp avatar May 20 '25 15:05 Phil1pp

@thelsing Your merge deleted one #endif

Phil1pp avatar Jul 22 '25 14:07 Phil1pp

Merged. Thank you for the contribution.

thelsing avatar Jul 23 '25 21:07 thelsing