logo elektroda
logo elektroda
X
logo elektroda

Verification Needed for 64-bit Flags Command on Multiple Platforms

XJ_ 1926 38
Best answers

Can someone verify the 64-bit Flags command change on other platforms besides the simulator and BK7238?

The 64-bit flags change appears to work on other tested platforms: on RTL-B/RTL8720D, all flags could be set without error and there was no hard fault, although flag 13 was still deselected after reboot [#21457513][#21459645] On TR6260, the new flag value was also accepted, but the remaining flag 13 issue was still present and the main GUI could halt on reboot, which was already seen before this PR [#21459843] For verification, the main thing to check was whether `strtoull()` works correctly on the main SDKs (ESP, BL, LN), since Beken was already confirmed OK and all current targets are 32-bit [#21457366] The WEB UI display of value 0 was also fixed separately, and the PR was merged afterward [#21459741][#21460862]
Generated by the language model.
ADVERTISEMENT
  • Helpful post
    #1 21456883
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    I modified the Flags command to support 64bit. The display on WEBui is also fixed. Checked on the simulator and on BK7238. Is there anyone who can verify this on other platforms?

    test:

    flags 18446744073709551615


    Screenshot of the OpenBK7238 user interface displaying a list of flag settings.

    Added after 38 [seconds]:

    PR: https://github.com/openshwprojects/OpenBK7231T_App/pull/1548
  • ADVERTISEMENT
  • #2 21456900
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    Wouldn't it break config on platforms where long is 8 bytes?

    Btw, what was the original reason to make flags into 2 integers, instead of an uint64_t?
  • #3 21456907
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    insmod wrote:
    Btw, what was the original reason to make flags into 2 integers, instead of an uint64_t?

    I don´t know. Maybe, first version have 32 flags only.

    Added after 11 [minutes]:

    insmod wrote:
    Wouldn't it break config on platforms where long is 8 bytes?

    You're right, changed to uint32.

    Added after 3 [minutes]:

    BTW, on which platform for OBK is a long actually 8 bytes long? Are they all 32 bit mcu's, or not?
    It's my fault, I'm a developer mainly for Win and on 64bit Win (LLP64) long is 32bit
  • #4 21456953
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21456907 Currently all are 32bit, but who knows in the future. And while long on 32bit is usually 4 bytes, who knows what some compilers would do. I know that i've seen 4 bytes long on 64 bit windows.
  • ADVERTISEMENT
  • #5 21456954
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    >>21456953
    OK, thanks to uint32, the flags are ready for the 64-bit future ;-)
  • #6 21457325
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    I don't remember well, but I think I've started with a single 32-bit integer. Then I added another 32 bits it has turned out that there is a long-standing bug with flag set (or read?). It has been tacked several times but we didn't get any definitive fix, unless PR 1548 works well on all platforms?
    Helpful post? Buy me a coffee.
  • #7 21457353
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    Ok will test. Is the latest build looking final for testing?

    Are there platforms I shouldn't bother with at all because it'll definitely not work? And should all the ESPs be treated as one test or one from each series required - like one ESP32-C#, one ESP32-S# etc
  • ADVERTISEMENT
  • #8 21457359
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    One thing I remember is that my initial flags code was working well on Windows. That's why the bug was not found for so long...
    Helpful post? Buy me a coffee.
  • #9 21457366
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    >>21457353
    It is final. There is no need to test all devices, all of them are 32bit.
    The thing to test is if funcion strtoull() works ok on the main SDKs (ESP, BL, LN). Beken is ok.

    u.newValue = (uint64_t)strtoull(args, NULL, 10); 
  • #10 21457368
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    Hey, I've just got an idea!

    Maybe we could do a selftest system like the one on Windows, but designed to run on Device?

    For example, put it into the cmd_selfTest.c and make there a long list of commands with result assertions.

    Then we could run it on physical devices to make sure that everything is okay.

    This could be very useful, especially considering platform differences and such....

    We already had issues related to those, for example:
    - time_t size (32 bit vs 64 bit)
    - missing realloc on BL602
    - strange sprintf behaviour (remember static IP page?)
    Helpful post? Buy me a coffee.
  • #11 21457373
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    >>21457368
    p.kaczmarek2 wrote:
    Maybe we could do a selftest system like the one on Windows, but designed to run on Device?

    I think this is not necessary. The main problems are revealed on win, and the "special" unexpected ones would be detected by the test with very little probability anyway.
  • #12 21457377
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    Are you sure? I suspect that even at this moment realloc is still broken on BL602... @miegapele may know more about it.
    Helpful post? Buy me a coffee.
  • #13 21457380
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    p.kaczmarek2 wrote:
    moment realloc

    I don't know what the problem is with realloc, but if the same problem will be on windows, would selftest find it?
  • #14 21457385
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    No, realloc implementation is per platform. That's why it's (as I suspect) broken on BL602, but works on other platforms.

    Related issue:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1529

    That's why I think we may benefit from making a simple self-test that runs on any platform, with #define entry in obk_config.h , so it takes 0 space in Release builds.
    It could test for basic stuff, like JSON parsing, commands execution, etc.
    Helpful post? Buy me a coffee.
  • #15 21457388
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    I mean, if we didn't know about it and the problem wasn't programmed to be checked

    Added after 4 [minutes]:

    p.kaczmarek2 wrote:
    It could test for basic stuff, like JSON parsing, commands execution, etc.

    but ok, the fact is that this would save a lot of work testing new things on platforms other than where they were debugged.
  • Helpful post
    #16 21457513
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    1548_merge_66c6fb20c815
    OpenW600 settings screen with selected flags
    Screenshot of the OpenW800_CDD5556C settings panel with enabled MQTT and LED flags.
    Configuration panel of OpenLN882H with active MQTT flags.
    View of user interface with OpenBL602 flag settings, most of which are checked.
    OpenESP32S3 interface with active flags for MQTT and LED configuration.
    OpenRTL87X0C application interface with a list of set MQTT flags.
    Screenshot of flag settings for OpenRTL8710B_601D473E.

    All set flags without error apart from RTL-B which had a hard fault. It came back up with all but 1 set though

    Code: Text
    Log in, to see the code


    List of configuration flags with flag 13 highlighted.

    Added after 3 [minutes]:

    setting flag 13 and saving thereafter does not cause a hard fault though

    Added after 3 [minutes]:

    interesting. with all flags cleared and only flag 13 set it'll hard fault if you move to the home page.

    Added after 2 [minutes]:

    I guess that's this it doesn't like
    Screenshot showing pin states with various settings, where only P28 is set to '1'.

    Added after 16 [minutes]:

    but unrelated to the flags fix. The same happens with general release 1.18.47 and only flag 13
    Code: Text
    Log in, to see the code
  • #17 21457587
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    @divadiow Thanks for the great test. So just to be sure, the RTL error is not related to PR, or should I do something?

    Added after 1 [minutes]:

    divadiow wrote:
    but unrelated to the flags fix. T

    OK, I see.
  • #18 21457592
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    I am adding self test system to build device.
    https://github.com/openshwprojects/OpenBK7231...mmit/a00d88b2a112c260985661cd079b7a5deba9a014

    Usage:
    1. enable ENABLE_TEST_COMMANDS in obk_config.h
    2. add your command to cmd_test.c
    Code: C / C++
    Log in, to see the code

    Code: C / C++
    Log in, to see the code

    3. add it to drv_test.c:

    Screenshot showing source code in Microsoft Visual Studio.
    4. do build

    5. in build run:
    
     backlog startDriver Test; StartTest 100;
    

    100 means 100ms interval between steps.
    It runs in such a way, that it first prints command it will run, it waits 100ms for log to come through, then runs command, then checks run result, then waits 100 ms, and pritns again....

    Sample run:
    Screenshot of a software test log with messages about test results.
    Test interface with toggle buttons and test results.

    The most important thing to note here is that if some command crashes, you can also run it from console without test driver.

    Please give me initial feedback, but also wait 1 day before running it. I will improve it a bit soon.
    Helpful post? Buy me a coffee.
  • #19 21457611
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    p.kaczmarek2 wrote:
    Please give me initial feedback

    Yeah, that looks good. I'll definitely check it out later.
  • #20 21457612
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    See this commit for test of math expression with setChannel:
    https://github.com/openshwprojects/OpenBK7231...mmit/0d18dd0a229b6de6dfd1abd2a396c8de076e40c7
    And this commit for some LLM-generated basic tests:
    https://github.com/openshwprojects/OpenBK7231...mmit/1b455ef82ec026f914eccb7bea1f2a0ecbc5dcb5

    Added after 1 [minutes]:

    One of practical uses of this could be this cursed IP parse bug:
    View of Visual Studio editor with C code.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #22 21457658
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    Yes and this will be finally meaningful, and not pointless like testing on Windows, because those functions are outside our SDK and testing them on Windows won't tell us if they will work on Beken on BL602.

    Added after 1 [hours] 18 [minutes]:

    IP parse test:
    https://github.com/openshwprojects/OpenBK7231...mmit/23e67076c3bf9b0b035ed2bb77066238277f76c9
    Helpful post? Buy me a coffee.
  • #23 21458333
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    this all sounds quite good. How exactly do self-tests work and help? I'm not very codey, but it seems like a sensible thing to have in place. If, for example, a contributor proposes code changes in a new PR and they cause a problem somewhere, how does the self-test manifest? What and where fails? Somewhere in the build workflow log?
  • #24 21458365
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    I am thinking about creating a separate guide for that, but I can already start here.

    So, there are two types of self tests.
    1. Windows-only self tests - they are run in Windows simulator, they reside here:
    https://github.com/openshwprojects/OpenBK7231T_App/tree/main/src/selftest
    They are run on Github on each build:
    Screenshot showing results of a software build simulation.

    Those self tests are basically simulating a use case scenario, for example, setting up a LED, and then they check externally is the use case result as expected.
    For example, if we set two PWM pins, we expect CW control to show up and we expect Dimmer command to work. We expect certain things to be published when light state changse, we can test it as well. So, we simulate setting of two PWM pins, then we run some commands, and check is result as expected (for example, are output PWM values as expected for correct CW control).

    Example 1 - if we set channel 1 to 123, is $CH1 constant working in script and expands to 123?
    Code: C / C++
    Log in, to see the code

    If "buffer" is not "123", then SELFTEST_ASSERT_STRING will show error on Github build (red cross instead of green checkmark).

    Example 2 - if we set two PWM pins, are they correctly detected as CW light? Is light responding to commands and settings PWMs correctly?
    Code: C / C++
    Log in, to see the code

    Let's look deeper at one fragment:
    Code: C / C++
    Log in, to see the code

    This basically says:
    - if you have CW light set up, and OBK receives a POWER OFF Tasmota command, the led_enableAll variable should be 0 (false) and both PWMs should be 0
    - if you later receive POWER ON Tasmota command, led_enableAll is expected to be 1 (true) and for current configuration (set earlier in code) first PWM should be 100%, second 0% (because we earlier set up temperature 100% cold)

    Thanks to this mechanism, as soon as somebody breaks the expected behaviour (for example, adds a change that makes CW lights not working), we will know at compile time, because self test will catch it.

    2. Per-platform tests, introduced yesterday.
    The test runner is here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_test.c
    The test commands are here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/cmnds/cmd_test.c

    Per-platform can be only run on true platform devices, like BK7231, not in simulator.
    They were introduced because not everything can be tested in Windows simulator.
    Some things are per-platform, for example sscanf command, or realloc, etc.
    So we have "different" sscanf or sprintf on each platform - different on BK7231, W800, W600...

    That's why I added test commands like this one:
    Code: C / C++
    Log in, to see the code

    This checks IP parsing, and this is required, because it has proven problematic, see implementation:
    Code: C / C++
    Log in, to see the code

    This is not just a theoretical sample - we really had this issue:
    Screenshot of a comment discussing software update issues.
    As you can see above, we had a sscanf problem that requires special handling on W600/LN882H/Realtek, and we didn't catch it early.
    If we had per-platform device tests back then that cover str to ip, we would have caught it earlier.

    It is impossible to catch this problem on WIndows self tests, because it is present only on some platforms with their specific implementation.

    Thanks to the per-platform tests, it's now possible to catch it.
    If you compile OBK with test commands enabled, and if your platform has str_to_ip broken, then this code:
    Code: C / C++
    Log in, to see the code

    will attempt to parse "192.168.0.123", but it will fail,, then "if" will detect it, so it will return CMD_RES_ERROR.
    So, later, the drv_test.c will catch it, and it will show error here:
    Test panel displaying switch states and test results.

    Self tests are very useful, because they can quickly check if all tested features can work as expected. You don't need to setup a CW light to check if PWMs are set correctly - this is done by Windows selftests in SImulator on each Github build. You also don't need now to manually check each page like local ip config on every platform, because per-platform tests will cover it as well....

    How to run self tests?
    - to run Windows simulator self tests, just trigger online github build, they are ran automatically
    - to run per-platform tests, compile OBK with ENABLE_TEST_COMMANDS , flash it to your device, and run "backlog startDriver Test; StartTest 100;"

    I didn't have time to run per-platform tests myself, but I strongly suspect that at least realloc test will just crash BL602 device - realloc is known to be a problem on BL602.
    Helpful post? Buy me a coffee.
  • #25 21458377
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    thank you. that is very interesting and makes things clearer. fascinating!
  • #26 21458386
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    So now let's make a demonstration. We'll consider a hypothetical scenario where someone breaks some function by accident, for example, the channel set.
    I modified CHANNEL_Set_Ex to always set value to 0:
    Screenshot shows a GitHub pull request for merging a branch in the openshwprojects project.
    Then I commited changes to Github.
    Let's see what happens.
    It's building, so we wait a moment...
    Task list in progress on a version control platform with status information.
    And then we get:
    Dashboard showing the status of task checks in a build system.
    AS you can see, many self tests have failed. They expect channels to work, so they recognized that something is wrong:


    Computer screen from a CI/CD panel showing various build and test job statuses, with one error.
    Helpful post? Buy me a coffee.
  • #27 21458705
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    >>21458386
    great work, as usual!

    Added after 1 [minutes]:

    so this build simulator test will automatically run on every PR/update?

    Added after 55 [seconds]:

    Or does it have to be started manually?
  • #28 21458712
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    Build Simulator and the tests ran on Windows are nothing new, they are already in our Github for a month or more. They run with each commit.

    The only new thing that I introduced yesterday is the per-platform testing that can be started only manually on physical device.
    Helpful post? Buy me a coffee.
  • #29 21458729
    XJ_
    Level 12  
    Posts: 140
    Help: 13
    Rate: 38
    p.kaczmarek2 wrote:
    The only new thing that I introduced yesterday is the per-platform testing that can be started only manually on physical device.

    I see. It seemed strange to me how a test for a specific MCU HW could run on github ;-)
  • Helpful post
    #30 21459645
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    1548_merge_82ad074ae93b
    Screenshot of OpenRTL8720D settings interface with selected flag options.
    no hard fault but flag 13 is deselected on reboot, otherwise seems OK on RTL8720D

    Screen displaying PIN states.

Topic summary

✨ The discussion revolves around the modification of the Flags command to support 64-bit integers, with a focus on verifying its functionality across multiple platforms. The original implementation used two 32-bit integers due to historical limitations, but the transition to a single uint64_t is seen as a step towards future-proofing. Participants discuss potential issues with platform compatibility, particularly regarding the size of data types like 'long' on different architectures. Testing is emphasized, with suggestions for a self-test system to ensure consistent behavior across devices. Initial tests indicate successful flag setting, although some issues, such as a hard fault on the RTL-B platform, were noted. The conversation also touches on the importance of testing functions like strtoull() across various SDKs and the implementation of per-platform testing to catch platform-specific bugs.
Generated by the language model.

FAQ

TL;DR: OpenBK’s 64-bit Flags update was checked on 2 targets first, and testers then expanded it across Realtek, XR809, and TR6260. One maintainer called per-device testing "finally meaningful" because Windows checks cannot validate SDK functions like strtoull() on real MCUs. This FAQ helps OpenBK contributors verify PR 1548 safely and separate true 64-bit parsing results from older flag-13 bugs. [#21457658]

Why it matters: A flags parser that works on Windows but fails on one SDK can silently break settings, web UI behavior, or reboot persistence on real hardware.

Option What it checks well Main limitation
strtoull(args, NULL, 10) on device Real 64-bit decimal parsing on ESP, BL, LN, Beken SDKs Must be validated per platform
sscanf("%lld", ...) on device Alternate 64-bit read path for comparison C library behavior can vary by SDK
Windows simulator tests Fast regression checks on every commit Cannot prove SDK-specific libc behavior

Key insight: The thread’s main conclusion is that the 64-bit Flags PR itself looked good on tested 32-bit OpenBK platforms; the notable failures pointed back to pre-existing platform-specific issues, especially the older flag 13 behavior and SDK quirks.

Quick Facts

  • The original verification started on the simulator and BK7238, then expanded to ESP-, BL-, LN-, and Realtek-based targets to validate strtoull() outside Windows. [#21457366]
  • The on-device test runner uses StartTest 100, where 100 ms is the interval between printed test steps and result checks. [#21457592]
  • Testers reported RTL8195A Hard Fault logs after setting all flags, yet the device rebooted with all but 1 flag set, which strongly suggested a separate platform/UI issue rather than failed 64-bit parsing. [#21457513]
  • Windows simulator self-tests already run on each commit, while the newer per-platform tests must be started manually on physical hardware. [#21458712]
  • A maintainer listed prior cross-platform faults involving 32-bit vs 64-bit time_t, missing realloc on BL602, and unusual sprintf behavior, showing why device-level checks matter. [#21457368]

How can I verify the new 64-bit Flags command in OpenBK7231T_App on platforms other than BK7238 and the simulator?

Use a real-device check focused on the parser, not every board family. 1. Flash the PR build to one device per SDK family, such as ESP, BL, LN, or Realtek. 2. Run flags 18446744073709551615. 3. Confirm the value displays correctly, saves, reboots cleanly, and does not trigger SDK-specific faults. The thread says all current OpenBK targets are 32-bit, so broad device duplication is unnecessary; the key question is whether strtoull() works on each main SDK outside Beken. [#21457366]

Why were OBK flags originally stored as two integers instead of a single uint64_t?

They were likely split because the project started with only 32 flags, then grew later. One maintainer said the code began with a single 32-bit integer and another 32 bits were added afterward, which also exposed a long-standing bug in setting or reading flags. That history explains the two-part storage better than a deliberate preference for uint64_t. The thread does not give a stricter architectural reason than that evolution path. [#21457325]

What problems can happen if OpenBK uses long for flags on platforms where long might be 8 bytes?

It can break config layout and make stored flag data platform-dependent. That risk appeared immediately in review, and the fix was to switch the code to uint32-based parts instead of relying on long. This matters because OpenBK is 32-bit today, but future ports or unusual compilers could size long differently. In short, fixed-width integers keep 64-bit flags stable across builds, while long can shift structure size and storage rules. [#21456907]

What is strtoull() in C, and why is it being used to parse 64-bit flag values in OpenBK?

"strtoull() is a C library function that converts a text string into an unsigned long long integer, using a chosen base and returning a 64-bit-capable value on supported SDKs." OpenBK uses it because the command input arrives as text, and PR 1548 needs to read values up to 18446744073709551615 in base 10. The tested code path shown in the thread is u.newValue = (uint64_t)strtoull(args, NULL, 10);, which directly matches the 64-bit Flags goal. [#21457366]

How does strtoull(args, NULL, 10) compare with sscanf("%lld", ...) for reading 64-bit flags across ESP, BL, LN, and Beken SDKs?

strtoull(args, NULL, 10) was treated as the main path to test, while sscanf("%lld", ...) was considered a useful comparison target. The thread’s maintainers wanted both covered by the new per-platform tests because those functions come from each SDK’s own C library, not from OpenBK. That means a Windows pass does not prove they behave the same on ESP, BL, LN, or Beken. The practical conclusion was to add on-device tests for both parsing routes. [#21457621]

What is a Hard Fault on RTL8195A or RTL8720D, and how do you troubleshoot it when changing OBK flags?

A Hard Fault is a platform crash reported by the MCU runtime, often with register dumps and a halted or rebooting system. In this thread, RTL8195A printed a Hard Fault log after setting all flags, but later testing showed a similar crash with general release 1.18.47 and only flag 13 set. To troubleshoot, reproduce with a release build, test a single flag such as 13, and compare behavior before and after PR 1548. If the older build crashes too, the fault is not caused by the 64-bit Flags change. [#21457513]

How do I run the new per-platform self-tests on a physical OpenBK device using ENABLE_TEST_COMMANDS, startDriver Test, and StartTest 100?

Build a test-enabled firmware and run the device test driver. 1. Enable ENABLE_TEST_COMMANDS in obk_config.h, then add test commands in cmd_test.c and register them. 2. Add them to drv_test.c and compile the firmware. 3. Flash the device and run backlog startDriver Test; StartTest 100;, where 100 means a 100 ms interval between steps. The runner prints each command, waits, executes it, checks the result, and continues. [#21457592]

What is the difference between the Windows simulator self-tests and the new per-platform device tests in OpenBK?

Windows simulator tests catch logic regressions on every commit, while per-platform tests catch SDK and libc differences on real hardware. The Windows set runs in GitHub and validates use cases like channels, PWM, MQTT, or HTTP behavior inside the simulator. The newer device tests run only on flashed hardware and target platform-specific functions such as sscanf, sprintf, realloc, and parsing code. That split matters because a simulator pass cannot prove behavior on BK7231, W600, LN882H, or Realtek libraries. [#21458365]

Why did flag 13 fail to persist after reboot on RTL8720D, XR809, and TR6260 even though the 64-bit flags PR seemed to work?

Because the thread consistently treated flag 13 as a separate, older bug. Testers said RTL8720D, XR809, and TR6260 accepted the new 64-bit flag value, but flag 13 still cleared after reboot or triggered UI crashes. The PR author explicitly said the RTL8720D flag 13 problem was not related to PR 1548, and later reports on XR809 and TR6260 matched that same pattern. So successful 64-bit parsing and broken flag 13 persistence can happen together. [#21459741]

Which OpenBK platforms actually need testing for the 64-bit Flags PR if most supported MCUs are currently 32-bit?

You only need representative testing across the main SDK families, not every 32-bit board. The thread says there is no need to test all devices because current OpenBK targets are 32-bit; instead, the important check is whether strtoull() behaves correctly on ESP, BL, and LN, since Beken was already confirmed. A few cross-family samples therefore give higher value than many same-SDK boards. That keeps validation focused and fast for PR 1548. [#21457366]

How can per-platform self-tests catch SDK-specific issues like sscanf, sprintf, realloc, time_t size, or IP parsing bugs that Windows tests miss?

They run the suspect code on the actual SDK implementation, then return CMD_RES_ERROR if the result is wrong. The thread gives a concrete IP example: parse 192.168.0.123, then verify all 4 bytes. That mattered because %hhu handling had already failed on W600, LN882H, and Realtek, and realloc was still suspected broken on BL602. Windows tests cannot expose those MCU-specific libc differences, but per-device tests can fail immediately on hardware. [#21458365]

What is LLP64, and why does long stay 32-bit on 64-bit Windows while other platforms may behave differently?

"LLP64 is a data-model convention that keeps long at 32 bits while pointers and long long use 64 bits, which makes 64-bit Windows behave differently from many Unix-like 64-bit environments." That mattered in the thread because a contributor worked mainly on 64-bit Windows and assumed long behavior from that world. They then corrected the code to use fixed-width integers after realizing Windows LLP64 does not guarantee portable flag storage elsewhere. [#21456907]

Why did the OBK web UI show incorrect behavior for a flags value of 0, and how was that display bug fixed?

The web UI had a display issue for the exact value 0, separate from the 64-bit parser itself. After more testing, the PR author said they fixed the zero-value display and credited another tester for identifying it. They also stated the updated behavior was fine from their side after that correction. The thread does not publish the exact code change, but it clearly separates the UI bug from the core 64-bit flag parsing work. [#21459741]

What is the best way to add a dedicated 64-bit FLAGS self-test in OpenBK so future PRs do not break parsing or storage?

Add a per-platform command test that exercises both parse and persistence paths on real devices. A solid version should set a full 64-bit decimal value, read it back, save, reboot, and compare again; then add negative checks for 0 and a single-bit case like flag 13. The maintainer explicitly said they would add a FLAGS test for 64-bit flags, and that is the right place to verify strtoull() and sscanf() behavior outside Windows. This keeps future regressions visible before merge. [#21459788]

When testing PR 1548 on Realtek, XR809, or TR6260, what results suggest the issue is unrelated to the flags fix and instead tied to the older flag 13 bug?

The clearest sign is this pattern: the new 64-bit value sets correctly, but flag 13 still clears on reboot or crashes the main page exactly as older releases did. That happened on Realtek-family tests, XR809, and TR6260. One tester even reproduced the same fault on general release 1.18.47 using only flag 13, which isolates the failure from PR 1548. If baseline firmware shows the same reboot-persistence or UI crash, blame the older flag 13 issue, not the 64-bit parser. [#21459843]
Generated by the language model.
ADVERTISEMENT