Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fflush() support #1601

Closed
adamgreen opened this issue Mar 9, 2016 · 4 comments
Closed

fflush() support #1601

adamgreen opened this issue Mar 9, 2016 · 4 comments

Comments

@adamgreen
Copy link
Contributor

A few weeks ago I was reviewing PR #1458 from @neilt6 and it got me curious as to what was actually up with fflush(). I have looked at it a bit over the last few days and now have some thoughts that I figured might be worthy sharing here to potentially start a conversation and maybe even come up with a solution. Forcing aggressive syncing on within the FATFileSystem as is currently done is probably not the best solution so it would be cool if we could come up with something better.

What's up with fflush()? In newlib (used by many GCC based toolchains for ARM) it's main task is to flush any queued up writes in the buffers associated with FILE* streams. So it makes sure that outstanding writes from within the FILE* stream buffers get flushed down to the file system layer. However the code doesn't do anything which would then request that the file system layer flush it's outstanding writes to non-volatile media. The ARM/Keil fflush() functionality appears to be similar. However, ARM/Keil did previously make sync calls down to the file system through the _sys_ensure() sys call but this has since been deprecated. The mbed SDK even implements this deprecated sys call in retarget.cpp On a related note, I don't really see a convenient place to hook in the lower level flushing of file system writes in newlib's sys call layer either.

One of the ideas I had had was to implement a new mbed_fflush() API in retarget.cpp which would first call the standard fflush() routine to flush FILE* buffers and then go about calling the fsync() method on the appropriate FileHandle objects to perform a lower level file system flush to media.

This is a prototype I built of that idea:

extern "C" int mbed_fflush(FILE *file) {
    /* First call the toolchain's default implementation to let it flush the stream to the filesystem. */
    int result = fflush(file);
    if (result != 0)
        return result;

    /* Now ask the file system to flush the data to the actual storage media. */
    if (file != NULL) {
        /* Request that the file system flush the file handle of this specific stream. */
        return _fflush_fh(fileno(file));
    }

    /* NULL pointer means to flush all open files. */
    for (size_t i = 0; i < sizeof(filehandles)/sizeof(filehandles[0]); i++) {
        if (filehandles[i] != NULL && _fflush_fh(i+3) != 0)
            result = EOF;
    }
    return result;
}

static int _fflush_fh(int fh)
{
    /* Do nothing for stdin/stdout/stderr. */
    if (fh < 3)
        return 0;

    /* Call fsync() method if FileHandler pointer isn't NULL. */
    FileHandle* fhc = filehandles[fh-3];
    if (fhc == NULL)
        return EOF;
    if (fhc->fsync())
        return EOF;
    return 0;
}

I did some testing with that on GCC_ARM and it appeared to work as expected. I then took it over to the online compiler and I hit a snag! This code requires access to the fileno() API so that it can determine which FileHandle* maps to a particular FILE* stream. I couldn't find this API or anything like it with the online compiler. As far as I can tell the FILE* pointer is opaque on that platform as well so no simple dereferencing of a field appears to be possible either.

Another thought I have had is that maybe we could just break the flushing process up into two parts:

  • First the user calls fflush() to cause the FILE* stream buffered writes to be pushed down to the file system level.
  • Next the user calls a fflush() method on the file system object itself to have it iterate through all of its own open handles and then call the fsync() method on each.

My prototype of this solution can be found in this commit from another GitHub repo that I have been working on recently: (adamgreen/SDCard@859b1af). If we were to go with that type of solution, then it might make more sense to add the fflush() method support to the file system base classes instead of these FATFileSystem specific ones.

Thoughts??

@sg-
Copy link
Contributor

sg- commented Mar 10, 2016

Let's further investigate fileno()

@adamgreen
Copy link
Contributor Author

I do think that fflush() as it is currently implemented is correct. It should really just be expected to flush the FILE* stream buffers to the underlying file system layer. That is really all the Standard C Library indicates that it should do.

The Posix sync() API is what you would use to dump the underlying buffer cache to physical media. So what should really be added to the mbed sdk is a sync() or mbed_sync() function that could be called after the libC fflush() function.

  • It could be implemented in the FileSystemLike/FileBase classes similar to what I did in the (adamgreen/SDCard@859b1af) prototype but renamed to sync instead of flush and pushed further down into the mbed SDK bases classes.
  • It could also be done in retarget.cpp by iterating through the filehandles[] array and calling the fsync() method on each open handle.

The first method has the advantage that an individual file system could override the virtual sync() method and perform some work at file system scope instead of or in addition to work at the scope of the individual files. The FATFileSystem can perform everything it needs at the file handle level so either method works for it.

With respect to fileno(), it isn't a Standard C Library function so ARM/Keil not supporting it is ok.

@bridadan
Copy link
Contributor

While I admit I'm not that familiar with the FileSystem code base, I would say having a sync() call would be extremely useful for things like Serial. Right now when you change the baud on a serial instance, there are times when the baud will change even if it's in the middle of flushing out the FIFO (which had a different baud rate at the time). It would be very useful to be able fflush() before baud rate changes occur. Right now I think the only option is to busy wait.

@ciarmcom
Copy link
Member

ciarmcom commented Aug 1, 2016

ARM Internal Ref: IOTMORF-213

@sg- sg- removed the mirrored label Aug 12, 2016
deepakvenugopal added a commit to deepakvenugopal/mbed-os that referenced this issue Aug 9, 2018
…..4a188ea

4a188ea Merge branch 'release_internal' into release_external
27ba18e removed ws resources from nanostack.
b693eae Merge pull request ARMmbed#1778 from ARMmbed/ws_bbr_update
543dd1e Renamed symbol to micro seconds.
ab5d98a Added ND proxy support to ws border router
f7c71c0 Remove new unittests from release external.
ac55c15 Merge branch 'release_internal' into release_external
f9b9e47 Fix GCC_ARM/ARM compiler warnings (ARMmbed#1777)
40efd39 Coverity tool reported error fix (ARMmbed#1776)
b063457 Merge pull request ARMmbed#1775 from ARMmbed/mac_header_trace_fix
b1fd538 Removed Debug trace support from common mac header class
90a36a6 coverity reported error fixes. (ARMmbed#1770)
9644114 Merge pull request ARMmbed#1774 from ARMmbed/debug_trace_fix
1e490f0 Removed debug trace which could be called at interrupt routine
1373a5f Clarify parameter name in phy_csma_params_t (ARMmbed#1773)
4a32a6c fixes for coverity tool reported issues. (ARMmbed#1772)
545d262 Update copyright year (ARMmbed#1771)
5ae07da address error handling fix. (ARMmbed#1769)
13c1ceb Clean multicast address when interface is shutdown
88bb7cc correct interface passed to address compare. (ARMmbed#1768)
53949a4 Thread device registers new address upon receipt of error notification. (ARMmbed#1767)
1653b06 replace ETX calculation for Wi-SUN
745c1dd refactor RPL dis sending
6e1cc58 Merge pull request ARMmbed#1764 from ARMmbed/mle_purge_fix
0b920d8 Fixed broken neighbor purge from list
a6f3a0d Thread network data handling refactored (ARMmbed#1762)
87cc2c9 Merge pull request ARMmbed#1763 from ARMmbed/mle_fixs
944f9ca Fix broken MLE neigbor list write operation.
833e740 updated address error payload (ARMmbed#1761)
2565170 Add CBOR parsing to simpleenrolment message
e38c70f fix duplicate address detection (ARMmbed#1760)
7648c1c Scope updated to three and prefix added to destination address. (ARMmbed#1758)
5612e08 DUA.ntf updates (ARMmbed#1752)
708bb3b pbbr stop removed to fix failing tests. (ARMmbed#1757)
1444c2f Add POC code for storing multicast address
684efef Fix MLR message handling
b691b78 context id update (ARMmbed#1753)
5635089 fix key sequence issues when keys are rotated
74db027 fix for sleepy node poll. (ARMmbed#1750)
49adf2e Link entry for neighbour (ARMmbed#1749)
5bad8ee Correct MAC neighbour table sizes for Thread (ARMmbed#1748)
3858eb0 valgrind reported error: fixed uninitialised variables. (ARMmbed#1747)
24ef520 Update licenses in new WS files (ARMmbed#1745)
77dccdf valgrind tool reported error fix: (ARMmbed#1746)
9ac47a8 Adjust WS build configurations (ARMmbed#1744)
c593e2b DUA.ntf to MTD child implemented (ARMmbed#1735)
3f5c6c1 Update missing SPDX identifiers to test files (ARMmbed#1743)
130fec4 Fix GCC_ARM linker error with some Thread builds (ARMmbed#1742)
65574a4 Merge pull request ARMmbed#1741 from ARMmbed/merge_koli_to_master
2dc41c0 Merge remote-tracking branch 'origin/koli'
2fc10b5 Put smarter dag max rank increment 2048. 0 affect a lot of troubles.
d311040 RPL print update, nud and aneighbour update
f9b23d4 Fix compiler warnings (ARMmbed#1740)
5a1f295 Merge pull request ARMmbed#1738 from ARMmbed/master_merge_to_koli
abee481 Fix merge compile problems
2c77c37 Merge branch 'master' into koli
32fe4b8 Increase too small maximum root path length (ARMmbed#1737)
03bc696 Fix LLC unit test's
3702f57 LLC data indication and fhss channel set update
45905fa Update DHCP service memory allocation (ARMmbed#1734)
9c9b9e3 Fix crash which will happen if address registration fail and operation is triggered again by NULL pointer.
cb83216 Enabled proper wi-sun security level 6.
7990fa9 Fix data for 6lowpan when mle is disabled.
501a612 Wi-sun trigle timer update:
47619c4 Function name code conventions fix.
1350bc5 mac_neighbor_info() macro defned for simplify code
41b84e4 Added check when weighting rule update must do network scan.
0215058 Fix ns_dyn_mem_init stub
33398ef Added Neighbor connected and trusted state update for wisun
24aa802 Integrate Mac neighbour table to Thread and 6Lowpan code
37c6342 Mac neighbour table update
7bb978e Thread Neighbor class update
26dd252 Removed almost duplicate mle entry discover for ll64
7a0aaa5 Rename some parameters which will help integration to new neighbor table.
3f905a1 Update nsdynmemLIB unit test stub (ARMmbed#1730)
2bd3e91 Return 0 instead of -1 on null pointer (ARMmbed#1728)
fde5104 Function parameter and name refactor.
e0f7dcf Updates to thread extension bootstrap (ARMmbed#1714)
13b3b05 Thread Neighbor and MLE API update
49ccb9d Removed threadNeighbour flag from mle_table_entry_t.
e142eec Removed unused holdTime parameter from mle_table_entry.
c8a99cb MLE service Update and integrate new features
726b08b Adjust NULL string tracing (ARMmbed#1726)
66636b8 Merge pull request ARMmbed#1724 from ARMmbed/IOTTHD-2537
2710836 Enable security to wi-sun with test security key.
8994bb2 MAC Security update
c56886f MAC: Fixed frame length when calling FHSS TX conditions
4eb5567 CCM & AES update for support multiple user and context.
7544ef3 added response to confirmable unicast. (ARMmbed#1722)
a8a5a90 duplicate address detection fix (ARMmbed#1720)
721c0b0 MLE service releases CCM library in error case (ARMmbed#1719)
d0467a0 Fix stack overflow (ARMmbed#1718)
7ea9001 Added support for multiple registrations in one message
0a36af3 WS IE library update and LLC data confirmation update
4352709 MAC enhanced ACK RX and TX support
0b7f9fe Update Thread child id request timeout handling (ARMmbed#1715)
3e8df0a added neighbor advertisement sending after dad complete. (ARMmbed#1713)
a46a363 updated multicast address registration timer (ARMmbed#1711)
7c6c482 Added target EID tlv to Dua response
2d3aff9 Delete parent mle-entry in case of parent lost or updated (ARMmbed#1707)
b43db5f duplicate address handling (ARMmbed#1709)
cb54705 Address generation changed to slaac based generation (ARMmbed#1708)
ee0306b changed coap message type to non-confirmable. (ARMmbed#1706)
776e0e5 Merge pull request ARMmbed#1705 from ARMmbed/IOTTHD-2531
d92b2f9 Thread advertisement adjustment (ARMmbed#1703)
f8d3d67 WS: Learn parent unicast dwell time
bd88fa0 WS Lib: Fixed byte order of fixed channel
1f9162d Merge pull request ARMmbed#1704 from ARMmbed/IOTTHD-2484
2e15944 FHSS unit tests: Datarate storage removed
e64bd19 FHSS: Implemented checking TX time
0ba4b9a Merge pull request ARMmbed#1700 from ARMmbed/IOTTHD-2483
1adb52b coap message type decided based on destination (ARMmbed#1702)
d1cf42d multicast handling updated(ARMmbed#1701)
44110a1 Thread bootstrap improvements (ARMmbed#1699)
34c0df9 FHSS unit tests: fixed tests after TX slot update
ddd7e92 FHSS: Calculate number of TX slots using defined slot length
eaf35d2 Lowered Thread advertisement speedup threshold values (ARMmbed#1691)
b67f2d8 Reset children when no response from parent (ARMmbed#1698)
3569c8a Mleid bbr fix (ARMmbed#1697)
1fc81fc Thread device learns weighting from advertisement (ARMmbed#1696)
ba98835 Merge pull request ARMmbed#1689 from ARMmbed/IOTTHD-2475
28307de Randomize channel used in fixed channel
3412f4a WS bootstrap: Moved calculating and setting FHSS hop to own function
51a498b reset Dodag if global address is lost.
c0e8cae Merge branch 'koli' into IOTTHD-2475
0ec37a6 Count the amount of configuration solicits
c8f5c8d FHSS unit tests: Updated FHSS config tests.
490384f FHSS unit tests: Test TX/RX slots
4fdbc09 FHSS: Calculate hop count using RPL rank
8f194f8 FHSS: Implemented TX slot calculation
b06b58a FHSS: Implemented setting hop count API
d73d210 FHSS: Moved own hop to common FHSS structure
caafff0 FHSS: Check TX slot for unicast frames
7406149 Merge pull request ARMmbed#1684 from ARMmbed/IOTTHD-2476
cc5f6d8 FHSS: validate received synch info.
c48f0ef Merge pull request ARMmbed#1687 from ARMmbed/disable_channel_traces
d5d1a13 Fixed trickle configuration for Discovery
eef3bd7 FHSS: Disable FHSS channel debugs for WS
fc74a31 Fixed unit test for support extensions.
e803974 FHSS and Mac extension enable update.
4859f16 MAC RF extension enable
e73e9b2 Merge pull request ARMmbed#1682 from ARMmbed/IOTTHD-2460
03f7105 fixed EAPOL parent selection
cbdd2a9 Fixed set channel unit test
ce1ab34 FHSS: Do not change channel during asynch transmissions
c0456a3 Defined own structure to give CSMA backoff symbol time and cca mode.
dff1e7d Merge pull request ARMmbed#1677 from ARMmbed/merge_MtoK
34dcbb6 Merge pull request ARMmbed#1674 from ARMmbed/IOTTHD-2443
3f9b34d Merge branch 'master' into koli
f578c26 Updated border router configuration
1ce2385 RF PHY extension update
32db0cd FHSS: Learn FHSS configuration from parent PA config
5974344 Merge pull request ARMmbed#1670 from ARMmbed/IOTTHD-2449
82a8bca FHSS: support FHSS created by application
67f578a Calculated RSL from neighbours
4aa6890 Merge pull request ARMmbed#1664 from ARMmbed/IOTTHD-2442
65e2fad Fixed uninitialized parameter use at rpl instance allocate.
4767dd5 Merge pull request ARMmbed#1666 from ARMmbed/fhss_is_bc_flag_fix
6ffc81a FHSS unit tests: Fixed tests
14e1597 Fixed missing TX ime calculation for pre-builded MAC packet send.
03f447a FHSS: Do not use broadcast queue when fixed channel
40f3685 FHSS: do not push asynch messages in broadcast queue
45daec9 FHSS: FHSS is on BC channel by default
2dbc92c FHSS: Remove failed handle after successful transmission
a152f45 Merge branch 'koli' into IOTTHD-2442
ea583c6 FHSS: Fixed updating broadcast synch
c3aa7d1 Select correct parent based on network size and route cost
7bf3994 Fixed Code style warning.
2e1f32f Fixed WS_NESTED_IE information discover return length check.
445745a LLC Neighbor, Mac packet rebuild, mac timer update and phy Extension.
6cb78ff Distribute and learn network size
bc4f46f Merge pull request ARMmbed#1656 from ARMmbed/IOTTHD-2441
7f94971 FHSS: Added random timeout before polling TX queue after channel change
b6e40af Merge pull request ARMmbed#1653 from ARMmbed/IOTTHD-2366
b28fcaa FHSS unit tests: Test failed TX allocation
fbe7795 Modified neighbour processing
b2cff91 FHSS: Use channel retries with WS
9b11201 FHSS: Moved TX fail handler in FHSS common
9fff108 Merge pull request ARMmbed#1650 from ARMmbed/merge_MtoK2
04797c2 Detect border router connection lost
5227398 Merge branch 'master' into koli
c0e8673 Merge pull request ARMmbed#1647 from ARMmbed/IOTTHD-2405
b7428e0 Merge pull request ARMmbed#1646 from ARMmbed/IOTTHD-2404
04449e8 FHSS unit tests: Test tx conditions and tx done callbacks
baaec35 Merge pull request ARMmbed#1644 from ARMmbed/ws_start_bc
69c1483 FHSS: Added excluded channels in neighbor table
92acbd2 WS: fixed merge conflicts
4e01969 Merge branch 'koli' into ws_start_bc
97200b3 Added version number increase in border router
27c8b65 FHSS: unit test update
6eb1255 FHSS: WS bootstrap to start broadcast schedule
659a1c4 FHSS: Write BT-IE
64f31b1 Merge pull request ARMmbed#1635 from ARMmbed/IOTTHD-2217
7706f2e FHSS: Do not return to RX channel when configured fixed channel
908eb17 Change RPL dis destination address to RPL address
666dbbf FHSS: Start broadcast schedule only if device is border router
98f9991 FHSS: Set neighbor info get function
126275b Merge pull request ARMmbed#1632 from ARMmbed/IOTTHD-2402
7fa2c2b WS: Learn channel function from parent
3980870 WS: Enable FHSS in bootstrap
ff72d95 Merge pull request ARMmbed#1629 from ARMmbed/cppcheck_fixes
85f1345 MAC: Check length pointer in ie vector length validate
672c4ef FHSS: Removed unnecessary fhss_api NULL
e5637fd FHSS: Initialize next_channel in broadcast channel calculation
cab9849 Send address registration to all PC parents (ARMmbed#1618)
5417936 Merge pull request ARMmbed#1623 from ARMmbed/mergeMtoK3
ad41972 Wait RPL to be ready before bootstrap is ready
a314db0 Merge branch 'master' into koli
f6ac06f Fhss ut improvements (ARMmbed#1622)
60a3b0f Fixed ETX update at LLC layer.
bb152ce Merge pull request ARMmbed#1617 from ARMmbed/IOTTHD-2321
49c213a FHSS unit tests: Added more tx handle tests
d5cc85a FHSS unit tests: Test removing parent info and get neighbor info
2d01008 FHSS unit tests: test setting parent BC info
681dedd Merge pull request ARMmbed#1613 from ARMmbed/IOTTHD-2320
7e59035 Fix broken unit test build.
6be455f WS ETX update
0efc062 ETX service update
e5aba03 WS PAN advert validation update
802ce3e WS bootstrap update
be296cd WS IE lib update
cfa5fd9 FHSS: Store parent broadcast info pointer
d0171be FHSS: Implemented get neighbor info and set/remove parent info callbacks
686ad9c Fix acynch --> asynch
b4059b8 WS neighbor class integrated to use new FHSS structures
c1b0d96 Merge pull request ARMmbed#1610 from ARMmbed/IOTTHD-2313
3d98860 FHSS: Implemented WS timing/schedule info structure
f96db0c Merge pull request ARMmbed#1607 from ARMmbed/merge_MtoK
72bb71f Fixed missing params after merging master to koli
d119df9 Merge branch 'master' into koli
8166585 Merge pull request ARMmbed#1602 from ARMmbed/IOTTHD-2311
90fbb45 Fixed LLC data unit test and add new functions to test
94e516f Integrated new WS IE header and payload API's
c553e8c WS ie library read update
7db0938 fixed mac_mlme valgrind errors.
4e2a743 Fixed thread test some of.
2680dd6 Fixed unstable unit test verified by valgrind.
18eda56 Merge pull request ARMmbed#1605 from ARMmbed/fhss_ut_valgrind_fix
eb96eae FHSS unit tests: fixed uninitialized varnings
27b7864 Fixed mac helper stub issues.
a88590f FHSS unit tests: Test tr51cf with excluded channels
3c9356a FHSS unit tests: Updated channel function tests
3a562d3 FHSS: Added excluded channels in channel function interface
b9606c9 FHSS: Static channel functions added
695e64c Merge pull request ARMmbed#1601 from ARMmbed/IOTTHD-2214
f973986 FHSS unit tests: Implemented FHSS common unit tests
2188af4 FHSS unit tests: Removed FHSS common functions from FHSS
e6bac6a Rename and refactor structures and function names.
b037628 Fixed unit test and stubs
8153fe3 Fixed Asynch request missing msdu_handle set at LLC.
1af46d8 WS bootstrap update
c771df0 LLC update UTT / BT information to ws neighbor and refresh mac neighbor
a43f6ad Mac helper API update:
14792db Ws neighbor hoping storage init integrated to interface init.
ae7945d Wi-sun neighbor hopping infor storage API definition
8f5c0bf FHSS: Removed fhss_beacon, fhss_beacon_tasklet and fhss_mac_interface
1e94358 Fixed unitest build.
3b9a4b0 Base Integration for Mac neighbor table to WS
7729e20 Mac neighbor table integrate to interface structure
2c6f30a Addede NULL check some of mac neighbor table check.
ed45fda Mac neighbor table unit test's.
0f85841 Added mac_neighbor_table stub's
fc4c97b Generic mesh neighbor table class.
4b81978 Process advertisement solicit and process response (ARMmbed#1592)
73c6bc1 Merge pull request ARMmbed#1589 from ARMmbed/IOTTHD-2218
057b6ec Omit NA sending in ARO success cases. Use ACK instead. (ARMmbed#1587)
4686668 ws_management_api unit tests (ARMmbed#1591)
9ae6511 FHSS unit tests: Implemented FHSS WS tests
8147217 Added trickle for Advertisement and processing of response (ARMmbed#1586)
c52b039 Merge pull request ARMmbed#1584 from ARMmbed/IOTTHD-2055
ac58048 FHSS: WS FHSS to use pre-set TX time
feeee0f FHSS: Synch callback to write ufsi
3e8112b Merge pull request ARMmbed#1578 from ARMmbed/IOTTHD-2286
4cd6c49 Merge pull request ARMmbed#1579 from ARMmbed/fhss_bug_fix
296a2f1 FHSS: Fixed scramble table bug
80e4270 FHSS: Added vendor defined CF support
24f418c Merge pull request ARMmbed#1575 from ARMmbed/IOTTHD-2288
a849c8d FHSS unit tests: Update FHSS tests
83bd90e FHSS: fhss_struct defined static
04ae3c3 FHSS: separated is_bc_callback to FHSS and WS
59fe586 FHSS: removed allocation of scramble table
1ca1d0b FHSS: Continued fhss_structure cleaning
036e19c Api Updates to LLC, ws_ie_lib and ws_info
192007b Fixed MAC Asynch message send and header build bug.
e0494b7 WS address registration callback for SLAAC (ARMmbed#1568)
93b7e32 FHSS: superframe handlers separated
ff66ae9 FHSS: Separate FHSS and WS parameters - Configuration structs moved
6ace69b Merge pull request ARMmbed#1573 from ARMmbed/fhss_cleaning1
07d4089 FHSS: Cleaning. Static functions. Separated tx fail and retry callbacks
8b9d39b Merge pull request ARMmbed#1571 from ARMmbed/fhss_callback_update
316b007 FHSS: removed unnecessary state set handler
db1ded0 WS LLC data service enabled to WS bootstrap.
c326e4a Fixed MPX header size calculation to MPX data request.
fa2d7d0 Removed Adaptation interface depency from LLC away.
4356ae8 separated BBR to own file (ARMmbed#1567)
75d93f8 Merge pull request ARMmbed#1564 from ARMmbed/IOTTHD-2213
19c4be6 FHSS: Separated tx done cb for FHSS and WS
3e326d1 FHSS: separated synch info write for FHSS and WS
15d4465 Function and parameter rename.
5af7992 Unit test for llc data service.
ffb3639 Fixed stubs.
3f66f6a LLC delete added for test purpose
b48cda0 Impelement LLC reset
47458c8 WS IE Lib unit test and fixed mac ie lib stub
6b6e509 MPX header module unit test.
55309e8 ws_llc_asynch_request() API update
5d9a379 Wisun spesific IE elemts write operation library.
c718985 FHSS: Calculate destination slot and ufsi
b4e1616 Merge pull request ARMmbed#1561 from ARMmbed/IOTTHD-2172
096aeef ws create interface and start rpl for poc (ARMmbed#1562)
77c851a FHSS: Added BSI in ws configuration
7d4a2f8 FHSS: Start broadcast schedule when bc intervals are known
e55ec8a FHSS: Prevent changing unicast channel when broadcast is active
b60b113 FHSS: Broadcast handler implemented
9bf1d1f WS Bootstrap skeleton (ARMmbed#1559)
3fb6390 Merge pull request ARMmbed#1560 from ARMmbed/mergeMtoK2
b78a370 Merge branch 'master' into koli
8b43c6e Merge pull request ARMmbed#1555 from ARMmbed/IOTTHD-2215
78314e8 FHSS: WS FHSS enable implemented
d04b818 FHSS: Compensation callback to return timeout value
472becb FHSS: FHSS configuration to union
b5f9e01 FHSS unit tests: Fixed after FHSS enable/down updates
2cbe6dc FHSS: Moved FHSS reset and down to FHSS module
4719187 FHSS: Separated FHSS enable functions for FHSS and WS FHSS
f4548d8 FHSS: Implemented WS configuration structure
7ace04b Initial commit for ws_bootstrap (ARMmbed#1556)
9e46cf9 Added malformed message check to nested IE discovery.
7f4c184 Added support for write and discover Nested IE elements.
e3d8150 SW MAC Asynch data request support
9a98177 Merge pull request ARMmbed#1552 from ARMmbed/cf_update
30075dd FHSS: TR51 channel function updated (bug in the spec?)
6b04d5a Merge pull request ARMmbed#1548 from ARMmbed/IOTTHD-2093
4249fad Integrated ws llc and mpx features.
a49bf11 Fix Const pointer wrong use.
3e1972f WS LLC module implementation base
957f270 MPX frame support
93f0ed7 MAC ie library update:
b2198b3 MPX support Integrate
2531c49 WS LLC and MAC MPX API definition and IE types definition.
a5493d2 FHSS: Do not send TX failure if TX in progress in channel change
958991a FHSS: Few FHSS functions to static
7237796 Merge pull request ARMmbed#1545 from ARMmbed/IOTTHD-2097
f794990 FHSS: Implemented destination channel change in TX handle callback
d2957a1 FHSS: fhss tx conditions callbacks added
c1e7300 FHSS: hard coded channel function
1d54c7d FHSS: fhss tx handle callbacks added
0cc1889 FHSS: Moved external API set to fhss and fhss_ws
c6cfb6c Merge pull request ARMmbed#1544 from ARMmbed/fhss_headers_refactored
1b4e203 FHSS: refactoring FHSS header files
e047723 Merge pull request ARMmbed#1541 from ARMmbed/IOTTHD-2171
5d98e3e FHSS: Added support for TR51 channel function
c8a9c7c FHSS: function to calculate nearest (larger or equal) prime number
5e70ec1 FHSS: ws struct to hold ws specific parameters
f2d7558 FHSS unit tests: Fixed tests
149f17b FHSS: Own create api for WS
e19de33 FHSS: WS to use Direct Hash channel function
fb99776 FHSS: Some cleaning
7a21ca1 FHSS: Added common superframe handler
a881580 FHSS: Added ws handler for FHSS state set
f7ab36c FHSS: Created FHSS state set handler
f6c61fc Added Copyrights
c445590 MAC IE element library
6e94b08 MCPS-Data-REQ API update
38aedc5 Remove commented code away.
663fd3e Fixed missing doxygen tags.
b9f7bf4 MAC functional updates and fix's:
2cef8ac Merge pull request ARMmbed#1538 from ARMmbed/mergeMtoK
321f700 Merge pull request ARMmbed#1534 from ARMmbed/IOTTHD-2047
146d7c4 Merge branch 'master' into koli
100db21 FHSS unit test: Added FHSS common to unit test makefile
37425ca FHSS: Separated common FHSS functions to own module
59b7b76 FHSS: Removed massive trace flags
60dfccb FHSS: Removed unnecessary channel functions
e456662 FHSS: Removed scramble table generation from fhss enable
b643622 Merge pull request ARMmbed#1532 from ARMmbed/IOTTHD-2049
b741f98 MCPS Data request API update.
c329f61 MAC API update and internal update
55861f3 FHSS unit tests: Fixed tests after API change
f9a31e9 FHSS API: Added callback to read synch info
f94b2ab FHSS: FHSS to use synch info callback
6830fd3 FHSS API: Added synch info write callback
ad5a1e1 Merge pull request ARMmbed#1527 from ARMmbed/IOTTHD-2095
3ed145f FHSS API: Added new configurations
0f9f0bb FHSS: Platform API to support multiple simultaneous timeouts
bf65e9c Unit tests: Added PHY extension stub
322167e MAC: RX time get function implemented
23d3a58 MAC: Created a function to set TX time
2384c33 PHY API: extension to support timestamp
209e49a Merge pull request ARMmbed#1528 from ARMmbed/IOTTHD-2046
89a85a8 FHSS: Added copyright headers, comments etc.
5d0f44e Unit tests: DH1CF channel function tests implemented
fbd5568 FHSS: DH1CF channel functions implemented
cf03db2 FHSS: Implemented tr51 channel functions
00af7f1 Unit tests: Created channel function unit tests

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 4a188ea
mysterywolf added a commit to mysterywolf/rt-thread that referenced this issue Aug 15, 2022
该问题在Keil-MDK中没有一个太好的解决方案,Keil曾经提供了底层桩函数_sys_ensure,但是目前已经被废弃。因此唯一的解决方案就是每写完一句,就调用fsync去同步一次。
该问题在mbedos社区也进行过讨论,他们也面临和我们相同的两个问题:
1. Keil-MDK无有效的fflush解决方案,mbedos依然在使用淘汰的_sys_ensure桩函数。
2. Keil-MDK没有fileno函数,我方少部分软件包因此而无法使用Keil平台编译。
参考:ARMmbed/mbed-os#1601
mysterywolf added a commit to mysterywolf/rt-thread that referenced this issue Aug 15, 2022
…e,但是目前已经被废弃。因此唯一的解决方案就是每写完一句,就调用fsync去同步一次。

该问题在mbedos社区也进行过讨论,他们也面临和我们相同的两个问题:
1. Keil-MDK无有效的fflush解决方案,mbedos依然在使用淘汰的_sys_ensure桩函数。
2. Keil-MDK没有fileno函数,我方少部分软件包因此而无法使用Keil平台编译。
参考:ARMmbed/mbed-os#1601

issue: RT-Thread#4928


经过进一步测试发现,Keil-MDK中的fflush函数已经退化成服务于STDOUT的函数,Keil-MDK内部有一个buffer可以存放fputc(stdout) 发过来的数据,如果调用fflush,这些数据是可以flush出去的。但是如果是真正的文件数据,fflush函数并没有提供任何桩函数接口可以让文件flush数据出去。
Guozhanxin pushed a commit to RT-Thread/rt-thread that referenced this issue Aug 16, 2022
…e,但是目前已经被废弃。因此唯一的解决方案就是每写完一句,就调用fsync去同步一次。

该问题在mbedos社区也进行过讨论,他们也面临和我们相同的两个问题:
1. Keil-MDK无有效的fflush解决方案,mbedos依然在使用淘汰的_sys_ensure桩函数。
2. Keil-MDK没有fileno函数,我方少部分软件包因此而无法使用Keil平台编译。
参考:ARMmbed/mbed-os#1601

issue: #4928


经过进一步测试发现,Keil-MDK中的fflush函数已经退化成服务于STDOUT的函数,Keil-MDK内部有一个buffer可以存放fputc(stdout) 发过来的数据,如果调用fflush,这些数据是可以flush出去的。但是如果是真正的文件数据,fflush函数并没有提供任何桩函数接口可以让文件flush数据出去。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@sg- @adamgreen @bridadan @ciarmcom and others