Skip to content

Commit

Permalink
add CanNm demo
Browse files Browse the repository at this point in the history
  • Loading branch information
parai committed Jul 27, 2021
1 parent 1593f25 commit f2394ad
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 76 deletions.
82 changes: 6 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ This project now provide below BSWs:
Dem
Dcm

OsekNm
CanNm

Fee
MemIf (zero const only)
MemIf (zero cost only)
NvM

## Tools & Libraries
Expand All @@ -40,80 +43,7 @@ This project now provide below tools & libraries:

## prebuilt demo applications and its tools

### CAN bootloader demo

[download CAN.Bootloader.Simulator.on.Win10.7z](https://github.com/autoas/ssas-public/releases/download/CanBL-0.0.1/CAN.Bootloader.Simulator.on.Win10.7z), use 7z to unzip it and just double click the run.bat to let the demo run.

```bash
# File list:
App.s19.sign # prebuilt demo Application s19 file and it was signed
FlashDriver.s19.sign # prebuild demo flash driver s19 file and it was signed
CanBL.exe # prebuilt demo bootloader
CanSimulator.exe # CAN bus simulator over IP socket

Loader.exe # tool Loader act as UDS client to do software update, this tool can also be used to sign a s19 file.
libwinpthread-1.dll # runtime dependency
run.bat # entry point, double click to run the demo
```

After run, a tmp folder will be generated to store the related logs

```bash
Flash.img # Application Flash simulation
Fls.img # NvM/Fee Flash simulation
can0.log # CAN message over the simulated CAN bus 0
loader0.log # loader UDS message log
ssas.log # also a copy of loader UDS message log
```

```
# can0.log
can(0) socket driver on-line!
can socket D8 on-line!
can socket 94 on-line!
canid=00000731,dlc=08,data=[02,10,03,55,55,55,55,55,] [...UUUUU] @ 1.484271 s
canid=00000732,dlc=08,data=[06,50,03,13,88,00,32,55,] [.P....2U] @ 1.499895 s
canid=00000731,dlc=08,data=[02,27,01,55,55,55,55,55,] [.'.UUUUU] @ 1.562390 s
canid=00000732,dlc=08,data=[06,67,01,29,CF,A3,4B,55,] [.g.)..KU] @ 1.578014 s
canid=00000731,dlc=08,data=[06,27,02,51,5C,E5,38,55,] [.'.Q\.8U] @ 1.640509 s
canid=00000732,dlc=08,data=[02,67,02,55,55,55,55,55,] [.g.UUUUU] @ 1.656133 s
canid=00000731,dlc=08,data=[02,10,02,55,55,55,55,55,] [...UUUUU] @ 1.703005 s
canid=00000732,dlc=08,data=[06,50,02,13,88,00,32,55,] [.P....2U] @ 1.718629 s
canid=00000731,dlc=08,data=[02,27,03,55,55,55,55,55,] [.'.UUUUU] @ 1.765500 s
canid=00000732,dlc=08,data=[06,67,03,22,5A,54,16,55,] [.g."ZT.U] @ 1.781125 s
canid=00000731,dlc=08,data=[06,27,04,B6,02,33,84,55,] [.'...3.U] @ 1.843620 s
canid=00000732,dlc=08,data=[02,67,04,55,55,55,55,55,] [.g.UUUUU] @ 1.859245 s
canid=00000731,dlc=16,data=[00,0B,34,00,44,20,00,00,00,00,00,07,B0,55,55,55,] [..4.D .......UUU] @ 1.921739 s
canid=00000732,dlc=08,data=[04,74,20,02,02,55,55,55,] [.t ..UUU] @ 1.937364 s
```

```
# loader0.log
loader started:
enter extended session
request service 10:
TX: len=2 10 03
RX: len=6 50 03 13 88 00 32
PASS
okay
level 1 security access
request service 27:
TX: len=2 27 01
RX: len=6 67 01 29 CF A3 4B
PASS
request service 27:
TX: len=6 27 02 51 5C E5 38
RX: len=2 67 02
PASS
okay
enter program session
request service 10:
TX: len=2 10 02
RX: len=6 50 02 13 88 00 32
PASS
okay
```

* [CAN bootloader demo](examples/CAN-BOOTLOADER.md)

* [CanNm](examples/CanNm.md)

75 changes: 75 additions & 0 deletions examples/CAN-BOOTLOADER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# CAN BOOTLOADER

Download [CAN.Bootloader.Simulator.on.Win10.7z](https://github.com/autoas/ssas-public/releases/download/CanBL-0.0.1/CAN.Bootloader.Simulator.on.Win10.7z), use 7z to unzip it and just double click the run.bat to let the demo run.

```bash
# File list:
App.s19.sign # prebuilt demo Application s19 file and it was signed
FlashDriver.s19.sign # prebuild demo flash driver s19 file and it was signed
CanBL.exe # prebuilt demo bootloader
CanSimulator.exe # CAN bus simulator over IP socket

Loader.exe # tool Loader act as UDS client to do software update, this tool can also be used to sign a s19 file.
libwinpthread-1.dll # runtime dependency
run.bat # entry point, double click to run the demo
```

After run, a tmp folder will be generated to store the related logs

```bash
Flash.img # Application Flash simulation
Fls.img # NvM/Fee Flash simulation
can0.log # CAN message over the simulated CAN bus 0
loader0.log # loader UDS message log
ssas.log # also a copy of loader UDS message log
```

```
# can0.log
can(0) socket driver on-line!
can socket D8 on-line!
can socket 94 on-line!
canid=00000731,dlc=08,data=[02,10,03,55,55,55,55,55,] [...UUUUU] @ 1.484271 s
canid=00000732,dlc=08,data=[06,50,03,13,88,00,32,55,] [.P....2U] @ 1.499895 s
canid=00000731,dlc=08,data=[02,27,01,55,55,55,55,55,] [.'.UUUUU] @ 1.562390 s
canid=00000732,dlc=08,data=[06,67,01,29,CF,A3,4B,55,] [.g.)..KU] @ 1.578014 s
canid=00000731,dlc=08,data=[06,27,02,51,5C,E5,38,55,] [.'.Q\.8U] @ 1.640509 s
canid=00000732,dlc=08,data=[02,67,02,55,55,55,55,55,] [.g.UUUUU] @ 1.656133 s
canid=00000731,dlc=08,data=[02,10,02,55,55,55,55,55,] [...UUUUU] @ 1.703005 s
canid=00000732,dlc=08,data=[06,50,02,13,88,00,32,55,] [.P....2U] @ 1.718629 s
canid=00000731,dlc=08,data=[02,27,03,55,55,55,55,55,] [.'.UUUUU] @ 1.765500 s
canid=00000732,dlc=08,data=[06,67,03,22,5A,54,16,55,] [.g."ZT.U] @ 1.781125 s
canid=00000731,dlc=08,data=[06,27,04,B6,02,33,84,55,] [.'...3.U] @ 1.843620 s
canid=00000732,dlc=08,data=[02,67,04,55,55,55,55,55,] [.g.UUUUU] @ 1.859245 s
canid=00000731,dlc=16,data=[00,0B,34,00,44,20,00,00,00,00,00,07,B0,55,55,55,] [..4.D .......UUU] @ 1.921739 s
canid=00000732,dlc=08,data=[04,74,20,02,02,55,55,55,] [.t ..UUU] @ 1.937364 s
```

```
# loader0.log
loader started:
enter extended session
request service 10:
TX: len=2 10 03
RX: len=6 50 03 13 88 00 32
PASS
okay
level 1 security access
request service 27:
TX: len=2 27 01
RX: len=6 67 01 29 CF A3 4B
PASS
request service 27:
TX: len=6 27 02 51 5C E5 38
RX: len=2 67 02
PASS
okay
enter program session
request service 10:
TX: len=2 10 02
RX: len=6 50 02 13 88 00 32
PASS
okay
```

62 changes: 62 additions & 0 deletions examples/CanNm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# CanNm

Download [CanNm.Simulator.on.Win10.7z](https://github.com/autoas/ssas-public/releases/download/CanNm-0.0.1/CanNm.Simulator.on.Win10.7z), use 7z to unzip it and just double click the run.bat to let the demo run.

```bash
# File list:
CanNm.exe # prebuilt demo CanNm
CanSimulator.exe # CAN bus simulator over IP socket

libwinpthread-1.dll # runtime dependency
run.bat # entry point, double click to run the demo
```

Click on the first cmd "CanSimulator.exe" window to bring it frontend.

Press key "x" to request network mode of all CanNm Node from ID 0 to ID 4, you could see CanNm message over CAN bus as below:

```bash
can(0) socket driver on-line!
can socket CC on-line!
can socket D0 on-line!
can socket D4 on-line!
can socket D8 on-line!
can socket DC on-line!
canid=00000402,dlc=08,data=[02,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.180963 s rel 0.00 ms
canid=00000404,dlc=08,data=[04,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.219946 s rel 38.98 ms
canid=00000400,dlc=08,data=[00,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.231936 s rel 11.99 ms
canid=00000403,dlc=08,data=[03,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.237932 s rel 6.00 ms
canid=00000401,dlc=08,data=[01,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.257096 s rel 19.16 ms
canid=00000402,dlc=08,data=[02,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.287156 s rel 30.06 ms
canid=00000404,dlc=08,data=[04,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.295806 s rel 8.65 ms
canid=00000400,dlc=08,data=[00,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.302801 s rel 7.00 ms
canid=00000403,dlc=08,data=[03,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.312794 s rel 9.99 ms
canid=00000401,dlc=08,data=[01,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 4.333310 s rel 20.52 ms
```

Then press key "x" again to release network of all CanNm node, could see CanNm message stopped:

```bash
canid=00000400,dlc=08,data=[00,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 152.260422 s rel 562.07 ms
canid=00000401,dlc=08,data=[01,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 152.931290 s rel 670.87 ms
canid=00000400,dlc=08,data=[00,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 153.494019 s rel 562.73 ms
canid=00000401,dlc=08,data=[01,50,FF,FF,55,AA,FF,FF,] [.P..U...] @ 154.149460 s rel 655.44 ms
```

And in each cmd window of "CanNm.exe", message below could be seen:

```bash
INFO :CanNm NodeId=4, ReduceTime=90
INFO :application build @ Jul 27 2021 22:37:46
CanNm request
CANNM :0: confirm PN, flags 1
CANNM :0: Enter Repeat Message Mode, flags 101
CANNM :0: Enter Normal Operation Mode, flags 121
CanNm release
CANNM :0: Enter Ready Sleep Mode, flags 120
CANNM :0: Enter Prepare Bus Sleep Mode, flags 120
CANNM :0: Enter Bus Sleep Mode, flags 120
```

Note: the key "x" is used to toggle the request/release of CanNm network mode.

0 comments on commit f2394ad

Please sign in to comment.