Skip to content

Release candidate for mbed-os-5.13.1 #10952

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

Merged
merged 413 commits into from
Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
413 commits
Select commit Hold shift + click to select a range
4b3cb5d
STM32WB: Fix serial IRQ handling
Jun 7, 2019
de46fa4
K22F: Fix serial IRQ handling
Jun 7, 2019
8030ced
K24F: Fix serial IRQ handling
Jun 7, 2019
c56c15e
KW41Z: Fix serial IRQ handling
Jun 7, 2019
ffbb125
KW24D: Fix serial IRQ handling
Jun 7, 2019
c694e29
KL82Z: Fix serial IRQ handling
Jun 7, 2019
7fd7b9e
KL43Z: Fix serial IRQ handling
Jun 7, 2019
1524209
K66F: Fix serial IRQ handling
Jun 7, 2019
45a3d29
KL27Z: Fix serial IRQ handling
Jun 7, 2019
ebf7ecc
K82F: Fix serial IRQ handling
Jun 7, 2019
ac2d434
microlib support: Specify compiler version unable to build without th…
hugueskamba Jun 25, 2019
80469e2
TLSSocket: print certificate info only when tracing is enabled
Jun 19, 2019
a518a76
Add STM32H743ZI to IAR export definition
ABOSTM Jun 13, 2019
8e1d3dc
1. Include MBEDTLS_CONFIG_FILE before evaluating MBEDTLS_PSA_CRYPTO_C…
urutva Jun 24, 2019
b938402
Remove MBEDTLS_PSA_CRYPTO_C from PSA NS targets
urutva Jun 25, 2019
91ab957
Allow target or application level definition of extra TICKLESS stack …
LMESTM Jun 5, 2019
8cb8758
bootloader: Fix LPC55S69 bootloader segmentation
hugueskamba Jun 7, 2019
515ff2f
Update HAL Sleep manager test to cope with STM32 LPTIM HW
LMESTM May 23, 2019
342782b
Fix compilation issue for targets without LPTICKER or USTICKER
LMESTM Jun 10, 2019
d5648da
Remove unused variable
LMESTM Jun 13, 2019
a666e41
Further modifications in Sleep Manager test.
mprse Jun 18, 2019
8ab1611
sleep_manager_can_deep_sleep_test_check(): do not use ticker common l…
mprse Jun 18, 2019
f045050
Increase DEEP_SLEEP_TEST_CHECK_WAIT_DELTA_US
LMESTM Jun 19, 2019
6af2e66
Update test_lock_unlock_test_check() assertion to cope with new timings
LMESTM Jun 19, 2019
52c8fa6
Tests: SleepManager: Fix test_check for NRF5X
Jun 24, 2019
ece8777
STM32: pwmout_write: configure channel only when not already enabled
ABOSTM Jun 6, 2019
7b0c650
usb_device-msd test: fix powershell unmount script issue
maciejbocianski Jun 5, 2019
3d0771a
usb_device-msd test: improve error handling
maciejbocianski Jun 17, 2019
2ab6c95
usb_device-msd test: disable host side unmount on windows machines
maciejbocianski Jun 17, 2019
1c475be
usb_device-msd test: docs update
maciejbocianski Jun 17, 2019
bad0a72
usb_device-msd test: astyle fix
maciejbocianski Jun 19, 2019
779e67b
usb_device-msd test: OS type detection fix
maciejbocianski Jun 24, 2019
86dcc44
wait_us optimization
kjbracey May 17, 2019
338be93
Freescale MCUXpresso: optimize us_ticker
kjbracey May 17, 2019
34be611
STM: optimize us_ticker
kjbracey May 17, 2019
af33226
wait_ns micro-optimisation
kjbracey May 21, 2019
a9701dc
Remote "static" from MBED_FORCEINLINE
kjbracey Jun 27, 2019
69638e9
cellular socket flags updated
mudassar-ublox Jun 14, 2019
dc87064
Increase dns-response-wait-time
Jun 27, 2019
05f863d
Fix netconn_recv_tcp_pbuf ARMC6 linker error
Jun 27, 2019
6c99639
Fixed bug causing Nordic drivers to use a different critical section …
AGlass0fMilk Jun 20, 2019
e07e22b
Fix alignment
AGlass0fMilk Jun 24, 2019
dab5301
Make the sys_arch_protect() mutex be recursive.
Jun 18, 2019
461ef1f
Removing I2C and SPI pin names in SDP-K1 PinNames.h file. This is to …
malavikasajikumar Jun 18, 2019
a82dfb6
Require exact context type match
Jun 17, 2019
8e43f5f
Allow IPV4V6 stack type
Jun 17, 2019
26c3099
Fix astyle
Jun 25, 2019
3f57dac
NUCLEO_H743ZI2 new target support
jeromecoutant May 29, 2019
41a8c68
LPC55S69: fix cosFactor data size in header file
mathias-arm Jun 19, 2019
6b721e9
Fix idle thread stack underflow in debug build
ccli8 Jun 18, 2019
04d588d
STM: Correct macro test in us_ticker_defines.h
kjbracey Jul 1, 2019
a82706e
Kinetis MCUXpresso: Update the clock drivers
mmahadevan108 Jun 28, 2019
0d840c1
LP ticker workaround
LMESTM Mar 29, 2019
a8863e4
Manage lp_ticker delay at low level
LMESTM May 6, 2019
6f27812
STM32 targets: remove tickless from us ticker and delay ticker
LMESTM Jun 3, 2019
b6f4cbb
Update warning now that C++ wrapper is not needed anymore
LMESTM Jun 4, 2019
ee7cdd7
Update comments and fix typo
LMESTM Jun 4, 2019
696cf0a
STM32: lp_ticker optim: remove irq_handler variable
LMESTM Jun 4, 2019
e2d5652
STM32: lp_ticker optim: initialize handle once only
LMESTM Jun 4, 2019
a42e242
STM32 with low level ticker wrapper require Extra Idle stack
LMESTM Jun 25, 2019
5650ac9
Solve bug: Low frequency clock will now selected by given "lf_clock_s…
DBS06 Jul 1, 2019
36aa83c
FastModel: enable FLASHIAP componment
May 20, 2019
a663ce0
FastModel: enable kvstore
May 20, 2019
caa4e75
FastModel: change FVP_MPS2_M3 to FVP_MPS2 enable the MPS2 Family
May 20, 2019
14d275f
FastModel: change Fastmodel memory layout regions from 3 to 2
Jun 6, 2019
afcec90
Tests: enable kvstore test for Fastmodel for test code coverage
Jun 6, 2019
f53f94b
Fix SAADC resolution set in sdk_config. analogin_read_u16 assumes 12-…
AGlass0fMilk Jul 1, 2019
21de13d
Apply same resolution fix to nRF52832 targets
AGlass0fMilk Jul 1, 2019
631507a
Doubled ATHandler's BUFF_SIZE
Jul 1, 2019
c20bd63
Fixed unittests
Jul 2, 2019
a979ea6
Wait_ns () internal delay loop code alignment to 16 for decreasing ex…
tymoteuszblochmobica Jul 1, 2019
32e589e
IAR icf linker scripts modified to use dynamic heap allocation of all…
tymoteuszblochmobica Jul 1, 2019
ee42d33
Update Mbed version block
Jul 3, 2019
5231629
Add Watchdog HAL API specification headers
Nov 14, 2017
08be790
Add K64F reset reason reference implementation
Nov 17, 2017
97957c2
Add simple watchdog reference implementation for K64F
Nov 20, 2017
d2cd134
Fix watchdog API issues
Nov 22, 2017
4fa6d5d
Add Reset Reason platform API
Nov 27, 2017
1f59e54
Add reset reason reference implementation STM32
Nov 27, 2017
40add4a
Add function to fetch platform specific reset reason register values
Nov 27, 2017
c91b40e
Add independent watchdog reference implementation for STM32
Nov 27, 2017
50f81cb
Amend reset reason driver API
Nov 28, 2017
34b5122
Add Watchdog driver API
Nov 28, 2017
aaefe6c
Remove window and sleep mode options for watchdog API
Dec 4, 2017
172d310
Add missing license headers
Jan 8, 2018
6e002f6
Move watchdog parameter validation into the driver layer
Jan 8, 2018
00ffb4d
Fix Watchdog::stop on K64F target
Jan 8, 2018
facee00
K64F: watchdog HAL: Fix max_timeout.
fkjagodzinski Jan 9, 2018
0fcd6da
Add RESET_REASON and WATCHDOG definitions to hexiwear build target
Jan 16, 2018
87453a5
Rename watchdog.c -> watchdog_api.c to prevent name collision with Pl…
Jan 24, 2018
a4ca1af
Add definition of reset reason and watchdog doxy groups
bulislaw Jan 30, 2018
4c7d033
Tests: HAL API: Watchdog: Add tests
fkjagodzinski Nov 23, 2017
3d86796
Tests: HAL API: Watchdog: Add dev reset tests
fkjagodzinski Dec 11, 2017
88899f5
Tests: HAL API: Watchdog: Add time accuracy tests
fkjagodzinski Jan 15, 2018
ca1b590
Tests: Drivers: Watchdog: Add tests
fkjagodzinski Jan 30, 2018
ab63e30
STM32F4: watchdog HAL: Fix issues found with tests
fkjagodzinski Feb 7, 2018
4306c1b
K64F: watchdog HAL: Fix init() and stop()
fkjagodzinski Feb 19, 2018
dbee10d
Add RESET_REASON and WATCHDOG to doxygen options
bulislaw Mar 15, 2018
689df12
Document reset reason enum
bulislaw Mar 15, 2018
6fba6ce
Disable Watchdog on Odin as it fails intermittently
bulislaw Mar 19, 2018
f306e67
Tests: HAL: Watchdog: Fix timing accuracy test
fkjagodzinski Mar 15, 2018
45ad099
Tests: HAL API: Reset_reason: Add tests
fkjagodzinski Nov 29, 2017
a8df87e
Tests: Drivers: Reset_reason: Add tests
fkjagodzinski Jan 30, 2018
26349c4
STM: HAL: Reset_reason: Correct return values
fkjagodzinski Feb 21, 2018
9a898e5
Add text to watchdog documentation indicating that it will continue t…
Mar 27, 2018
c590876
Add Watchdog and ResetReason headers to mbed.h
Mar 27, 2018
82014cd
Add support for watchdog on Silicon Labs devices
stevew817 Mar 27, 2018
aa66fa7
Add implementation of reset reason on Silicon Labs parts
stevew817 Mar 27, 2018
7a2172c
NCS36510: Added watchdog implementation.
Mar 28, 2018
2a323a0
STM32 Watchdog : move API file to STM family level
jeromecoutant Mar 27, 2018
9aefe12
STM32 WATCHDOG : compilation issue with typed define
jeromecoutant Mar 27, 2018
ddbf7f6
STM32 WATCHDOG : update STM32L0 HAL_IWDG_Init to a newest version
jeromecoutant Mar 27, 2018
52d1181
STM32 WATCHDOG : use ST HAL in order to make code commun for all STM32
jeromecoutant Mar 27, 2018
3b3581f
STM32 WATCHDOG : increase timeout value
jeromecoutant Mar 29, 2018
774eeaf
fix bugs introduced on rebase
Jun 26, 2018
338790e
[NUC472] Fix WDT driver in BSP
ccli8 Jul 17, 2018
b79aee2
[Nuvoton] Support reset reason
ccli8 Jul 12, 2018
3bac928
[Nuvoton] Support watchdog timer
ccli8 Jul 16, 2018
040eea2
Enlarge wait time for flushing serial buffer in Greentea test code
ccli8 Jul 23, 2018
f19a281
Fix NUMAKER_PFM_NANO130 cannot pass mbed_hal/watchdog_reset test
ccli8 Jul 23, 2018
bbf0aa5
Added reset_reason feature for TMPM066 & TMPM46B
Oct 26, 2018
81571fd
Added reset_reason feature for TMPM3H6 & TMPM4G9
Oct 26, 2018
ab600da
test(api-watchdog): Fix errors in compiling watchdog greentea tests
Oct 29, 2018
27ffe01
fix(hal-watchdog): Add feature guards to K64F watchdog implementation
Oct 30, 2018
0a5bd0e
Update license headers
Nov 19, 2018
5160209
Apply new astyle config style
Nov 19, 2018
97f622e
Fix more astyle failures
Nov 19, 2018
a5e13ff
Tests: Watchdog: Fix config access in the host script
Nov 22, 2018
c1d1ed3
Tests: Watchdog: Update the reset-to-sync delay
Nov 22, 2018
bccd65e
Added reset_reason feature for TMPM3HQ
Nov 23, 2018
0dcb74d
Edit ResetReason_tests.h
Nov 26, 2018
8cc0c8e
fix: Remove excess comma from device_has key in targets.json
Dec 11, 2018
5b16a9c
fix(hal-watchdog): Remove 'RESET_REASON' flags from unsupported devices
Dec 18, 2018
996d45c
fix(hal-watchdog): Add 'RESET_REASON' flags to supported devices
Dec 18, 2018
a0cf483
fix(hal-watchdog): Guard TMPM 'ResetReason' code behind feature flag
Dec 18, 2018
c263c04
Docs: Watchdog: Update code comments
Nov 27, 2018
30f2dc4
small grammatical changes
Nov 29, 2018
0246f27
Capitalizing Watchdog
Nov 29, 2018
fb94870
capitalizing class name
Nov 30, 2018
170db54
update:Remove DEVICE_WATCHDOG and added RESET_RESON in stm32 family
rajkan01 Feb 26, 2019
cbf2e2d
doxy spell check fix for watchdog
rajkan01 Feb 26, 2019
1fcad88
fix for build failure issues
rajkan01 Feb 27, 2019
2b86014
Revert "fix for build failure issues"
rajkan01 Feb 27, 2019
50af91b
Removed RESET_REASON for NRF52832,NRF52840 family and Removed WATCHDO…
rajkan01 Feb 27, 2019
0ecd0ed
fix for Jenkin build issue
rajkan01 Mar 1, 2019
559edec
Trailing space issue fix
rajkan01 Mar 1, 2019
d29ac01
Added the SPDX identifier
rajkan01 Mar 1, 2019
cc86c58
Removed RESET_REASON for NRF51_DK board
rajkan01 Mar 1, 2019
48dae11
Remove RESET_REASON from MCU_NRF52840
May 29, 2019
531ab07
Watchdog refactoring to multithreaded thread.
rajkan01 Jan 3, 2019
649cf44
Add HwWatchdog
rajkan01 Jan 9, 2019
0417776
Add SW Watchdog
rajkan01 Jan 17, 2019
ec0dff4
HW Watchdog and SW watchdog interface
rajkan01 Jan 18, 2019
fb3a4e2
Hw Watchdog UnitTest cases
rajkan01 Jan 23, 2019
cad2ad8
SW watchdog unittest cases
rajkan01 Jan 25, 2019
c6dd542
fix: Fixing rebased created bugs
rajkan01 Feb 26, 2019
af6d522
Fix for the Ci build issue
rajkan01 Mar 12, 2019
978f963
fix for spell check and header file
rajkan01 Mar 12, 2019
e605f59
fix for astyle
rajkan01 Mar 12, 2019
5d585ee
Incorporated the Reivew Comments
rajkan01 Mar 13, 2019
2693358
Incorporated the Reivew Comments
rajkan01 Mar 13, 2019
ba0ecbc
Update Watchdog
rajkan01 Mar 22, 2019
370581c
Added the ticker support
rajkan01 Apr 2, 2019
d66b6b8
Fixed the unittest case failure
rajkan01 Apr 2, 2019
fba521a
Fix for Problem copying the instance from BSS to stack
rajkan01 Apr 10, 2019
af553e7
Tests: Watchdog: Remove outdated driver tests
Feb 1, 2019
57e06e1
Tests: Watchdog: Add Watchdog Manager tests
Feb 1, 2019
23ac049
Tests: ResetReason: Use the HAL watchdog API
Apr 12, 2019
d7451b0
Tests: Update Watchdog Manager test
Jun 11, 2019
9f4058d
Tests: Watchdog: Update test case teardown
fkjagodzinski Apr 23, 2018
10d51cf
Tests: Watchdog: Decrease default timeout to 100 ms
fkjagodzinski May 15, 2018
c941499
Tests: Watchdog: Update timing test
fkjagodzinski May 25, 2018
acd5eaf
Test: update HAL reset_reason test
May 8, 2019
797e873
Test: update HAL watchdog test
May 9, 2019
227d586
Test: update HAL watchdog-reset test
May 10, 2019
71729c7
Test: update HAL watchdog-timing test
May 10, 2019
2e0385c
Test: update reset_reason driver test
Jun 12, 2019
8b0db26
Test: watchdog_mgr: Remove dead code
Jun 14, 2019
9f0e8e5
HAL: Watchdog: Update the header file
Jun 21, 2019
6418446
watchdog: fix copyright
0xc0170 Jun 26, 2019
baff7a1
HAL: ResetReason: Update the header file
Jun 25, 2019
e4c1f57
ResetReason: Update the header file
Jun 25, 2019
b06336a
HAL: Watchdog: Update the header file
Jun 26, 2019
cd458f8
watchdog: fix astyle issue
0xc0170 Jun 26, 2019
2731dc1
watchdog hal: remove space
0xc0170 Jun 26, 2019
0291caf
Edit reset_reason_api.h
Jun 26, 2019
547ecc4
Edit watchdog_api.h
Jun 26, 2019
808a1a9
Edit Watchdog.h
Jun 26, 2019
f5843db
Edit ResetReason.h
Jun 26, 2019
6b46ab0
Watchdog: refactor driver
0xc0170 Jun 27, 2019
37be7f8
VirtualWatchdog: software watchdog
0xc0170 Jun 27, 2019
98ffbcb
Remove watchdog manager
0xc0170 Jun 27, 2019
b1fa284
mbed: add Watchdog and VirtualWatchdog
0xc0170 Jun 27, 2019
8b01dc8
Watchdog: use get_instance to access watchdog hw
0xc0170 Jun 27, 2019
faa0841
VirtualWatchdog: fix protection macro
0xc0170 Jun 27, 2019
1b0d242
Watchdog: cleanup after singleton usage
0xc0170 Jun 27, 2019
fad3fed
Watchdog: kick method should not have any external dep
0xc0170 Jun 27, 2019
d8a9094
Watchdog: fix dtor
0xc0170 Jun 27, 2019
6081f5e
watchdog: add WatchdogManager
0xc0170 Jun 27, 2019
01e512b
watchdog: remove manager
0xc0170 Jun 27, 2019
771435d
watchdog: fix astyle errors
0xc0170 Jun 27, 2019
499c6ae
Watchdog: clean-up start
0xc0170 Jun 28, 2019
f14ed9e
VirtualWatchdog: make sure we are the only owner of watchdog
0xc0170 Jun 28, 2019
8e7dd38
Watchdog & VirtualWatchdog process() update
Jun 28, 2019
a54424b
Watchdog: fix const static
0xc0170 Jun 28, 2019
e7d2678
VirtualWatchdog: fix error code and timeout
0xc0170 Jun 28, 2019
b3cd9c7
error: add watchdog driver error
0xc0170 Jun 28, 2019
9409996
Watchdog: remove dead reference file
0xc0170 Jun 28, 2019
0519464
Watchdog: add missing docs doxygen
0xc0170 Jun 28, 2019
ecc8c9a
Watchdog: refactor timeout handling
0xc0170 Jun 28, 2019
7525ceb
VirtualWatchdog: fix doxygen docs errors
0xc0170 Jun 28, 2019
8194fce
Watchdog: fix callback - uses ms
0xc0170 Jun 28, 2019
7c5b6fa
Watchdog: fix timeout - use full range for watchdog
0xc0170 Jun 28, 2019
131cc6a
VirtualWatchdog: add config option to ctor to clarify the hw timeout
0xc0170 Jun 28, 2019
11e1568
VirtualWatchdog: fix is hw init definition
0xc0170 Jun 28, 2019
63a86e1
VirtualWatchdog: fix name for member timeout
0xc0170 Jun 28, 2019
c9cae20
VirtualWatchdog: fix default timeout value (1ms is unreal)
0xc0170 Jun 28, 2019
5892823
Watchdog: fix include paths - use module name
0xc0170 Jun 28, 2019
4101ab3
Watchdog: keep it simple - providing simple driver functionality
0xc0170 Jun 28, 2019
645f7f6
Watchdog: update unittests
0xc0170 Jun 28, 2019
a8a357a
unittest: rename watchdog to VirtualWatchdog
0xc0170 Jun 28, 2019
a44b82a
unittest: move watchdog files to drivers
0xc0170 Jun 28, 2019
f9502ee
unittest: remove platform watchdog (moved to drivers)
0xc0170 Jun 28, 2019
2aae7ee
watchdog unittest: fix naming after refactor
0xc0170 Jun 28, 2019
b73cbaa
unittest: add virtualwatchdog stub
0xc0170 Jun 28, 2019
bf5cd2c
VirtualWatchdog: fix missing kick and init check in process
0xc0170 Jun 28, 2019
4f4f6bf
virtualWatchdog: fix alignment for tickers
0xc0170 Jun 28, 2019
98af0c6
virtualWatchdog: fix alignment for tickers and one space
0xc0170 Jun 28, 2019
4ced882
Watchdog: example code - add kick()
0xc0170 Jun 28, 2019
cb70adf
Fix unittest errors
Jun 28, 2019
f4c8dda
Watchdog: fix space in code example
0xc0170 Jun 28, 2019
02836d8
Fix more unittest errors
Jun 28, 2019
dbddf98
Test: Watchdog: Add new driver tests
Jun 30, 2019
705dccd
Watchdog: Fix timeout constraints
Jun 30, 2019
cdd4b0c
Test: WatchdogManager: Remove tests
Jun 30, 2019
f868a47
Test: Watchdog: Fix astyle errors
Jun 30, 2019
75bae5e
VirtualWatchdog: process fail test expects 0 as reset - no ticker run…
0xc0170 Jul 1, 2019
b919220
Watchdog: add docs update about intention one vs multiple Watchdogs
0xc0170 Jul 1, 2019
248b49d
Test: Watchdog: Fix test_restart case
Jul 1, 2019
a02a41c
VirtualWatchdog: fix doxygen ingroup and ctor
0xc0170 Jul 1, 2019
1214253
VirtualWatchdog: add comment about exclusive access to Watchdog
0xc0170 Jul 1, 2019
fbba566
VirtualWatchdog: provide hw timeout via ctor
0xc0170 Jul 1, 2019
f3191df
Watchdog: remove config value for timeout, set it dynamically
0xc0170 Jul 1, 2019
ca095c7
VirtualWatchdog: use timeout in ctor to set hw timeout
0xc0170 Jul 1, 2019
f656603
Watchdog: Fix unittests
Jul 2, 2019
cd34612
Watchdog: remove VirtualWatchdog
0xc0170 Jul 2, 2019
840f281
Watchdog: start without arg uses max timeout from a target
0xc0170 Jul 2, 2019
271cf3c
Fix: MCU_NRF52832 does not support RESET_REASON.
0xc0170 Jul 3, 2019
769db45
SDT51822B does not support RESET_REASON.
0xc0170 Jul 3, 2019
5b52d6d
Revert "Fix: Allow target size restriction for LPC55S69"
0xc0170 Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 20 additions & 19 deletions TESTS/host_tests/pyusb_msd.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ def _callback_unmount(self, key, value, timestamp):
else:
self.report_error("unmount")

def _callback_os_type(self, key, value, timestamp):
system_name = platform.system()
if system_name == "Windows":
self.send_kv("os_type", 1)
elif system_name == "Linux":
self.send_kv("os_type", 2)
elif system_name == "Darwin":
self.send_kv("os_type", 3)

def setup(self):
self.register_callback("get_os_type", self._callback_os_type)
self.register_callback("get_serial_number", self._callback_device_ready)
self.register_callback('check_if_mounted', self._callback_check_if_mounted)
self.register_callback('check_if_not_mounted', self._callback_check_if_not_mounted)
Expand Down Expand Up @@ -204,25 +214,16 @@ def _disk_path_mac(serial):
@staticmethod
def _unmount_windows(serial):
disk_path = MSDUtils._disk_path_windows(serial)
tmp_file = tempfile.NamedTemporaryFile(suffix='.ps1', delete=False)
try:
# create unmount script
tmp_file.write('$disk_leter=$args[0]\n')
tmp_file.write('$driveEject = New-Object -comObject Shell.Application\n')
tmp_file.write('$driveEject.Namespace(17).ParseName($disk_leter).InvokeVerb("Eject")\n')
# close to allow open by other process
tmp_file.close()

try_count = 10
while try_count:
p = subprocess.Popen(["powershell.exe", tmp_file.name + " " + disk_path], stdout=sys.stdout)
p.communicate()
try_count -= 1
if MSDUtils._disk_path_windows(serial) is None:
return True
time.sleep(1)
finally:
os.remove(tmp_file.name)
cmd_string = r'(New-Object -comObject Shell.Application).Namespace(17).ParseName("{}").InvokeVerb("Eject")'.format(disk_path)

try_count = 10
while try_count:
p = subprocess.Popen(["powershell.exe", cmd_string], stdout=sys.stdout)
p.communicate()
try_count -= 1
if MSDUtils._disk_path_windows(serial) is None:
return True
time.sleep(1)

return False

Expand Down
163 changes: 163 additions & 0 deletions TESTS/host_tests/reset_reason.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
"""
Copyright (c) 2018-2019 Arm Limited and affiliates.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import time
from mbed_host_tests import BaseHostTest
from mbed_host_tests.host_tests_runner.host_test_default import DefaultTestSelector

DEFAULT_SYNC_DELAY = 4.0

MSG_VALUE_WATCHDOG_PRESENT = 'wdg_present'
MSG_VALUE_DUMMY = '0'
MSG_VALUE_RESET_REASON_GET = 'get'
MSG_VALUE_RESET_REASON_CLEAR = 'clear'
MSG_VALUE_DEVICE_RESET_NVIC = 'nvic'
MSG_VALUE_DEVICE_RESET_WATCHDOG = 'watchdog'

MSG_KEY_DEVICE_READY = 'ready'
MSG_KEY_RESET_REASON_RAW = 'reason_raw'
MSG_KEY_RESET_REASON = 'reason'
MSG_KEY_DEVICE_RESET = 'reset'
MSG_KEY_SYNC = '__sync'

RESET_REASONS = {
'POWER_ON': '0',
'PIN_RESET': '1',
'BROWN_OUT': '2',
'SOFTWARE': '3',
'WATCHDOG': '4',
'LOCKUP': '5',
'WAKE_LOW_POWER': '6',
'ACCESS_ERROR': '7',
'BOOT_ERROR': '8',
'MULTIPLE': '9',
'PLATFORM': '10',
'UNKNOWN': '11'
}


def raise_if_different(expected, actual, text=''):
"""Raise a RuntimeError if actual is different than expected."""
if expected != actual:
raise RuntimeError('{}Got {!r}, expected {!r}'
.format(text, actual, expected))


class ResetReasonTest(BaseHostTest):
"""Test for the Reset Reason HAL API.

Given a device supporting a Reset Reason API.
When the device is restarted using various methods.
Then the device returns a correct reset reason for every restart.
"""

def __init__(self):
super(ResetReasonTest, self).__init__()
self.device_has_watchdog = None
self.raw_reset_reasons = set()
self.sync_delay = DEFAULT_SYNC_DELAY
self.test_steps_sequence = self.test_steps()
# Advance the coroutine to it's first yield statement.
self.test_steps_sequence.send(None)

def setup(self):
sync_delay = self.get_config_item('forced_reset_timeout')
self.sync_delay = sync_delay if sync_delay is not None else DEFAULT_SYNC_DELAY
self.register_callback(MSG_KEY_DEVICE_READY, self.cb_device_ready)
self.register_callback(MSG_KEY_RESET_REASON_RAW, self.cb_reset_reason_raw)
self.register_callback(MSG_KEY_RESET_REASON, self.cb_reset_reason)
self.register_callback(MSG_KEY_DEVICE_RESET, self.cb_reset_reason)

def cb_device_ready(self, key, value, timestamp):
"""Request a raw value of the reset_reason register.

Additionally, save the device's watchdog status on the first call.
"""
if self.device_has_watchdog is None:
self.device_has_watchdog = (value == MSG_VALUE_WATCHDOG_PRESENT)
self.send_kv(MSG_KEY_RESET_REASON_RAW, MSG_VALUE_RESET_REASON_GET)

def cb_reset_reason_raw(self, key, value, timestamp):
"""Verify that the raw reset_reason register value is unique.

Fail the test suite if the raw reset_reason value is not unique.
Request a platform independent reset_reason otherwise.
"""
if value in self.raw_reset_reasons:
self.log('TEST FAILED: The raw reset reason is not unique. '
'{!r} is already present in {!r}.'
.format(value, self.raw_reset_reasons))
self.notify_complete(False)
else:
self.raw_reset_reasons.add(value)
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_GET)

def cb_reset_reason(self, key, value, timestamp):
"""Feed the test_steps coroutine with reset_reason value.

Pass the test suite if the coroutine yields True.
Fail the test suite if the iterator stops or raises a RuntimeError.
"""
try:
if self.test_steps_sequence.send(value):
self.notify_complete(True)
except (StopIteration, RuntimeError) as exc:
self.log('TEST FAILED: {}'.format(exc))
self.notify_complete(False)

def test_steps(self):
"""Generate a sequence of test steps.

This coroutine calls yield to wait for the input from the device
(the reset_reason). If the device gives the wrong response, the
generator raises a RuntimeError exception and fails the test.
"""
# Ignore the first reason.
__ignored_reset_reason = yield
self.raw_reset_reasons.clear()
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
__ignored_clear_ack = yield

# Request a NVIC_SystemReset() call.
self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_NVIC)
__ignored_reset_ack = yield
time.sleep(self.sync_delay)
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
reset_reason = yield
raise_if_different(RESET_REASONS['SOFTWARE'], reset_reason, 'Wrong reset reason. ')
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
__ignored_clear_ack = yield

# Reset the device using DAP.
self.reset_dut(DefaultTestSelector.RESET_TYPE_SW_RST)
reset_reason = yield
raise_if_different(RESET_REASONS['PIN_RESET'], reset_reason, 'Wrong reset reason. ')
self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
__ignored_clear_ack = yield

# Start a watchdog timer and wait for it to reset the device.
if not self.device_has_watchdog:
self.log('DUT does not have a watchdog. Skipping this reset reason.')
else:
self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_WATCHDOG)
__ignored_reset_ack = yield
time.sleep(self.sync_delay)
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
reset_reason = yield
raise_if_different(RESET_REASONS['WATCHDOG'], reset_reason, 'Wrong reset reason. ')

# The sequence is correct -- test passed.
yield True
74 changes: 74 additions & 0 deletions TESTS/host_tests/sync_on_reset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""
Copyright (c) 2018-2019 Arm Limited and affiliates.

SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import time
from mbed_host_tests import BaseHostTest

DEFAULT_SYNC_DELAY = 4.0

MSG_VALUE_DUMMY = '0'
MSG_KEY_DEVICE_READY = 'ready'
MSG_KEY_START_CASE = 'start_case'
MSG_KEY_DEVICE_RESET = 'reset_on_case_teardown'
MSG_KEY_SYNC = '__sync'


class SyncOnReset(BaseHostTest):
"""Host side test that handles device reset during case teardown.

Given a device that performs a reset during a test case teardown.
When the device notifies the host about the reset.
Then the host:
* keeps track of the test case index of the current test suite,
* performs a dev-host handshake,
* advances the test suite to next test case.

Note:
Developed for a watchdog test, so that it can be run on devices that
do not support watchdog timeout updates after the initial setup.
As a solution, after testing watchdog with one set of settings, the
device performs a reset and notifies the host with the test case number,
so that the test suite may be advanced once the device boots again.
"""

def __init__(self):
super(SyncOnReset, self).__init__()
self.test_case_num = 0
self.sync_delay = DEFAULT_SYNC_DELAY

def setup(self):
sync_delay = self.get_config_item('forced_reset_timeout')
self.sync_delay = sync_delay if sync_delay is not None else DEFAULT_SYNC_DELAY
self.register_callback(MSG_KEY_DEVICE_READY, self.cb_device_ready)
self.register_callback(MSG_KEY_DEVICE_RESET, self.cb_device_reset)

def cb_device_ready(self, key, value, timestamp):
"""Advance the device test suite to the next test case."""
self.send_kv(MSG_KEY_START_CASE, self.test_case_num)

def cb_device_reset(self, key, value, timestamp):
"""Wait for the device to boot and perform a handshake.

Additionally, keep track of the last test case number.
"""
try:
self.test_case_num = int(value)
except ValueError:
pass
self.test_case_num += 1
time.sleep(self.sync_delay)
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
Loading