Skip to content

Commit

Permalink
Merge pull request #47 from nbosb/dev-update-test-mcan
Browse files Browse the repository at this point in the history
Test m_can peripheral
  • Loading branch information
nbosb authored Aug 2, 2024
2 parents 12a2507 + 952fac9 commit 73d0422
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Download software
working-directory: ./sw
run: |
wget https://github.com/aut0/avp64_sw/releases/download/v2024.07.30/buildroot_6_5_6.tar.gz
wget https://github.com/aut0/avp64_sw/releases/download/v2024.08.02/buildroot_6_5_6.tar.gz
tar -xvf buildroot_6_5_6.tar.gz
rm buildroot_6_5_6.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Download software
working-directory: ./sw
run: |
wget https://github.com/aut0/avp64_sw/releases/download/v2024.07.30/buildroot_6_5_6.tar.gz
wget https://github.com/aut0/avp64_sw/releases/download/v2024.08.02/buildroot_6_5_6.tar.gz
tar -xvf buildroot_6_5_6.tar.gz
rm buildroot_6_5_6.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
##############################################################################

cmake_minimum_required(VERSION 3.12)
project(avp64 VERSION 2024.07.30 LANGUAGES C CXX)
project(avp64 VERSION 2024.08.02 LANGUAGES C CXX)

option(AVP64_BUILD_TESTS "Build unit tests" OFF)
option(AVP64_BUILD_RUNNER "Build avp64 runner" ON)
Expand Down
34 changes: 29 additions & 5 deletions tests/linux_boot.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

import sys
import pexpect
import os
import time

sim='$<TARGET_FILE:avp64-runner>'
cfg='@config@'

cmdline = f'{sim} -f {cfg}'
cmdline = f'{sim} -f {cfg} -c system.term0.backends=term'

print(cmdline)

Expand All @@ -34,6 +34,7 @@ p.expect('1000b000.uart: ttyAMA2 at MMIO 0x1000b000')
p.expect('1000c000.uart: ttyAMA3 at MMIO 0x1000c000')
p.expect('timeriomem_rng 10007000.rng: 32bits')
p.expect('spi_oc_tiny 10020000.spi')
p.expect('m_can_platform 10021000.can: m_can device registered')
p.expect('smsc911x 10010000.lan9118 eth0')
p.expect('rtc-ds1742 1000e000.rtc: registered as rtc0')
p.expect('mmc0: SDHCI controller on 1000d000.mmc')
Expand All @@ -44,17 +45,40 @@ p.expect('avp64 login:')
p.sendline('root')

# can we run commands?
p.expect('#')
p.expect('# ')
p.sendline('uname')
p.expect('Linux')

# did all processors boot up?
p.expect('#')
p.expect('# ')
p.sendline('cat /proc/cpuinfo')
for cpu in range(@nrcpu@):
p.expect('processor')

# CAN test -------------------------------------------------------------------
p.expect('# ')
p.sendline('ip addr')
p.expect('can0:')

# can we bringup the can controller?
p.expect('# ')
p.sendline('ip link set can0 up type can bitrate 1000000')

# can we bringup the can controller?
p.expect('# ')
p.sendline('ip addr')
p.expect('can0: <NOARP,UP,LOWER_UP,ECHO>')

# can we send a package?
p.expect('# ')
p.sendline('cansend can0 123#deadbeef')
p.expect('# ')

# test ok - shut down simulation
p.expect('#')
p.sendline('devmem 0x10008000 32 1')
p.expect(pexpect.EOF)

# check if can packed arrived
with open('system.canbridge.tx', 'r') as f:
line = f.readline()
assert('frame #1 CAN 123 [00] de ad be ef' in line)
2 changes: 1 addition & 1 deletion vscode-tutorial/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ while [ -h "$SOURCE" ]; do
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

LINUX_SW=https://github.com/aut0/avp64_sw/releases/download/v2024.07.30/buildroot_6_5_6.tar.gz
LINUX_SW=https://github.com/aut0/avp64_sw/releases/download/v2024.08.02/buildroot_6_5_6.tar.gz
LINUX_SRC=https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.5.6.tar.gz
LINUX_ARCHIVE="${LINUX_SRC##*/}"
LINUX_DIRNAME="${LINUX_ARCHIVE%.tar.gz}"
Expand Down

0 comments on commit 73d0422

Please sign in to comment.