1*** Variables ***
2${UART}                       sysbus.uart0
3${URI}                        @https://dl.antmicro.com/projects/renode
4
5*** Keywords ***
6Create Machine
7    [Arguments]     ${elf}
8
9    Execute Command             mach create
10    Execute Command             using sysbus
11    Execute Command             machine LoadPlatformDescription @platforms/cpus/cc2538.repl
12
13    Execute Command             machine PyDevFromFile @scripts/pydev/rolling-bit.py 0x400D2004 0x4 True "sysctrl"
14
15    Execute Command             sysbus LoadBinary @https://dl.antmicro.com/projects/renode/cc2538_rom_dump.bin-s_524288-0c196cdc21b5397f82e0ff42b206d1cc4b6d7522 0x0
16    Execute Command             sysbus LoadELF ${elf}
17    Execute Command             sysbus.cpu VectorTableOffset `sysbus GetSymbolAddress "vectors"`
18
19*** Test Cases ***
20Should Write, Read and Erase Flash using Flash Controller
21    Create Machine              ${URI}/cc2538-contiki_ng-flash_test.elf-s_174036-32132ab0ef2488062468544c05b5c0ea8142cb94
22
23    Create Terminal Tester      ${UART}
24    Start Emulation
25
26    Wait For Line On Uart       CC2538 FLASH TEST
27    Wait For Line On Uart       FLASH SIZE: 0x10000
28    Wait For Line On Uart       [OK] Data written with memset successfully
29    Wait For Line On Uart       [OK] Data written successfully               timeout=12
30    Wait For Line On Uart       [OK] Data erased successfully
31    Wait For Line On Uart       [OK] Data erased successfully
32