Commit Graph

45 Commits

Author SHA1 Message Date
Eric Wild e84a571c04 fix the host/emulation build
Going for __ARM__ to distinguish host and firmware builds is not
sufficient here, since we might be building on a ARM host, so there is
now a OCTSIMFWBUILD define.

Change-Id: Ib07a58b6102b1709f295d08a764c6f118a2d0b9e
2019-12-02 08:47:45 +00:00
Eric Wild 2288703527 enable the final slot
The debug uart is shared with slot 7, so in order to use sim slot 7 the
pin config and the uart config needs to be changed. Going back to using
the debug uart works by defining ENABLE_DBG_UART7

Change-Id: I8f3c7c60306941159c35307a5c1e38c2a2bd2fe1
2019-11-28 13:42:16 +01:00
Eric Wild c7d980cc86 move iso7816_3 to common dir
Change-Id: Id8cfc9247988ae999f5544d936d67f12e3902b92
2019-11-28 13:42:16 +01:00
Harald Welte 03d6ebbd9a Add card_uart driver for ASF4 USART
Change-Id: Ic690055bc332ccca3de7c5f4429399cf9ff1d4da
2019-11-28 13:42:16 +01:00
Harald Welte f9a979a5f8 sysmoOCTSIM: Proper Makefile targets
It's really bad practsie to generate different output files from one
target, which breaks dependency generation and the like.  Let's have
separate Makefile targets for each output file we generate, all
depending on the .elf file.

Change-Id: Ie83722a9b61cfcd9865950ab4c088f59a15427ba
2019-11-13 16:34:10 +00:00
Harald Welte 29d8db6d82 Makefile: Add 'make mrproper' for removing all bin/elf/etc output files
Change-Id: I01e4b3f0224977fd38ed126f37f33ac9324f5abc
2019-11-13 16:33:53 +00:00
Harald Welte 47fc3f2099 sysmoOCTSIM: Create symlinks of last-built .bin and .elf
Change-Id: I6046069dd74e8a6f9461d3089259bbd90425c1c4
2019-11-12 17:33:44 +01:00
Eric Wild 6a902a39e9 allow different prefixes, print memory usage
Change-Id: If34b5eba2992f8f9f75ea234b94467af46b028c6
2019-10-09 17:58:15 +02:00
Eric Wild d5eaa9f400 split ccid into common and host-only code
Change-Id: I175c4efdafedc1d8953d3fb03f2d622a7a74af3b
2019-10-09 13:18:21 +02:00
Harald Welte 37ab4babca name binaries including their git version number
Change-Id: I21a782de7e6a51351f8c8a4a24bb06107ebe0b14
Related: OS#3452
2019-06-20 18:43:30 +02:00
Kevin Redon 99d82ab4d5 Makefile: automatically get output directory list
Change-Id: I8a18a5f04b03f9fa95a1b4f5ee77945e4fa8db07
2019-06-13 18:34:46 +02:00
Harald Welte 6a739d1841 Makefile: Allow user to override libosmocore install prefix
We should probably use PKG_CONFIG to do this in the next step..

Change-Id: Ie1eda223da3e22b6b1eea73cfcca499cf3ba7940
2019-06-13 18:32:07 +02:00
Kevin Redon f80ad405e8 Makefile: add missing hpl/rtc directory
Change-Id: I3fed159173467d1da091758fe2a87bef2cd2e3c7
2019-06-06 13:29:33 +02:00
Harald Welte d1bd5c42dd Add RTC peripheral from ASF4 (CALENDAR)
Change-Id: I04b6608b72f22cf9829a5bfdddf7cbbbbe8ebb3e
2019-05-17 18:23:55 +02:00
Harald Welte 9bb8bfedb3 Update from Atmel START 1.0.87 to 1.1.134
Change-Id: I095f2f3f4de8ebba154b7d8f9f763a2fa6472ebd
2019-05-17 16:10:00 +02:00
Harald Welte fa9ea7703d Makefile: build ccid_{device,proto} as part of firmware
Change-Id: I3e7afb7ed623f9ac65318bb9ee43eadcea59077f
2019-05-17 13:05:26 +02:00
Harald Welte 71d01e4bfb Makefile: cosmetics (indent, alphabetic sort)
Change-Id: If34d344261bc3982f5fda07aa287e1080671f4ea
2019-05-17 12:50:42 +02:00
Harald Welte c85aab2ecd Makefile: Ensure the firmware binary is called sysmoOCTSIM.bin
Change-Id: Ib8480d8f1f3535efb7c35c01ea4ef24d3c3302a9
2019-05-17 11:05:20 +02:00
Harald Welte 059d1b0eec Ensure the git version ends up in compiled firmware binary
This uses the usual 'git-version-gen' magic we use in all Osmocom
projects.

Change-Id: I076430e5eae32f46f87b778e362b089ae8d0e8ee
2019-05-17 10:53:53 +02:00
Harald Welte 488ddaeeca Makefile: Use Variables for generating compiler/binutils names
Change-Id: I68db7c35e73b1ac5f45ed6e0c6c29045b0cb5581
2019-05-17 10:53:27 +02:00
Harald Welte fad379ac88 Makefile: Move compiler flags to variable
Change-Id: Iacfad9f585d06d31de15bb4c2bddca84ab230b53
2019-05-17 10:42:02 +02:00
Harald Welte b2fc511179 Makefile: Move include directories to INC_DIRS variable
I really hate the Atmel copy+paste style makefile where every include path
is specified three times, rather than using variables.

Change-Id: I39dd880ced341aaea54e30e8b670dbaea445aa8b
2019-05-17 10:37:45 +02:00
Harald Welte 6135be9910 Makefile: Update comment; this is no longer automatucally generated
Change-Id: I75748df90a722462d62067db2db7910035ffb99c
2019-05-17 10:31:40 +02:00
Harald Welte e4ea2b2f62 Makefile: Remove {OBJS,DEPS}_AS_ARGS variables
... which make it very clumsy to add new files to the makefile by hand.

Change-Id: Icfd42470bc43dc49feabc425774737b43f928d03
2019-05-17 10:30:40 +02:00
Harald Welte bdf1b35fbb integrate libosmocore logging into firmware
We do so using our own 'raw' log target to avoid the 4k-on-stack
buffer of libosmocore _output() function.

Change-Id: I7a10b5b2b50bcee0154a1fa3fc43756aec836226
2019-05-17 10:22:00 +02:00
Harald Welte dda661c298 Makefile: Use -fdata-sections, not just -ffunction-sections
Change-Id: I7445da79e17de0ded6496493c2f22364e7cdd426
2019-05-17 10:20:50 +02:00
Harald Welte 3304ca2281 WIP integrate with libosmocore in as far as msgb_alloc() works
Change-Id: I99617d217ab938ab57746445906b1af8902b5ff7
2019-05-16 23:05:21 +02:00
Harald Welte 34a8706e45 Re-structure USB descriptors
Use structures to define the USB descriptors of the sysmoOCTSIM device.

While at it, turn it from a pure CDC-ACM to a CDC-ACM + CCID interface,
so we can expose a virtual UART at the same time as the chip card reader
device.

Change-Id: I0423d733476f37c16bdb6abc651b7ad5ca7ac63e
2019-05-16 23:05:21 +02:00
Harald Welte cdb1ee3be8 Add a new (skeleton of a) USB CCID class driver
This tries to implement a USB CCID (Chip Card Interface Device) Class
core driver in "ASF4 style".  Code is currently mainly untested.

Change-Id: Ia4d8a6cdc3de26fdc83dcbf89db894b513915a9a
2019-05-16 23:05:21 +02:00
Harald Welte 5df0be6727 Import libtalloc-2.1.14 into the tree
talloc is a hirearchical memory allocator which Osmocom uses a lot
for its userspace programs on Linux.  Experiments show that it's
actually very much possible to use it inside of microcontroller firmware
projects, particularly the small subset which we generally use.

Change-Id: Ibd31b40d5b75b3fc1783a6b02b0e97da430e0f60
2019-05-11 20:21:41 +02:00
Kevin Redon 632502db10 add ISO 7816-3 definitions and utilities
Change-Id: Ice4eba380126ff92089b71d0ea328b0110f7ffec
2019-05-09 15:46:38 +02:00
Kevin Redon de9fb2ec6d add async library with ring on TX
the standard async library expected the caller to wait until the
transmission was complete (by counting using the transmit callback
or checking using usart_async_get_status) before freeing/reusing
the memory holding the data to be transmitted.
this is not practical when using stdio on top of the peripheral
since printf returns directly and reuses the memory.
the new USART async library has a ring buffer for the data to be
transmitted (similar to the data being received).

WARNING: write is blocking when the TX buffer is full.
this prevents loosing data.

Change-Id: Iafd5295b90ef9f428f640314c24f6c31ee82c9d6
2019-05-09 15:46:36 +02:00
Kevin Redon 0bc0d74e88 update CMSIS to 5.1.2
this changes comes from Atmel START

Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355
2019-04-17 12:06:11 +02:00
Kevin Redon 0c7ea79dcf remove example code
as the code will use alternative libraries, the examples will not
be able to compile anymore.
plus they are not required for the firmware and the example code
can be downloaded from Atmel start.

Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031
2019-04-17 11:06:20 +02:00
Kevin Redon c94e0fc0e6 add ASFv4 M2M (memory-to-memory DMA) middleware
This is form Atmel Start and provides functionality for hardware-based
DMA copies from memory to memory.

Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a
2019-04-17 10:25:09 +02:00
Harald Welte 67b2abacd2 manual_test.c: New manual board testing mode
Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
2019-04-16 21:13:48 +02:00
Harald Welte ff9f4ceca9 Add mnimalistic command line interface "command.c"
This is a very simplistic command line interface parser which
various parts of the code can use to register textual commands
on the debug UART.

Change-Id: I2d289228fb97ecde5602e9756f3d7c51fa65a3b7
2019-02-27 13:42:27 +00:00
Harald Welte 361ed2072b Switch SERCOM7 (Debug UART) to sync mode + add STDIO
this will allow us to do printf()

Change-Id: Ibf4ba961d4bbf8d787558f38f3d557422587aad3
2019-02-27 13:17:17 +00:00
Harald Welte c3f170d214 Support for sysmoOCTSIM NCN8025/SX1503 control
This adds an I2C bit-banging layer, defines the four busses on the
sysmoOCTSIM and adds some high-level functions to control the NCN8025
for each SIM slot.

Change-Id: Ic5287cf80d2be2070c504e9d40f7c6fc0d37d8b9
2019-02-24 23:05:15 +01:00
Kevin Redon eff5cb52c5 relocate application to after the DFU bootloader
without this relocation the DFU bootloader can jump to the
application but following executed code would not be the one from
the application.

Change-Id: Ieeefcf80918fd10e48debab6ff08505f6588811c
2019-02-07 15:56:05 +01:00
Kevin Redon 4e39b0194f switch from dev board to prototype
the SAM E54 Xplained Pro development board uses a SAM E54P20N
micro-controller.
the sysmocom sysmoOCTSIM prototype uses a SAM E54N19A
micro-controller.
the system LED and UART debug GPIO are different, else the code
is the same.
the Atmel START definitions have been updated accordingly.

Change-Id: Ifd15f6759c51b42a8d11b09f9f495d7e7a5b6afc
2019-02-07 15:56:05 +01:00
Kevin Redon ccbed0b1df add SERCOM HAL Async library
Change-Id: I530a5bc5ee7e89149eb251bda0adf7963733d2ee
2019-02-07 15:56:05 +01:00
Kevin Redon e676557550 rename application to main
also remove unused armcc.
only the GCC cross-compiler is used.
the ARMCC Makefile would not be maintained.

Change-Id: Ib6ec525885943afba9b24df88a5bee8009df95b5
2019-02-07 15:56:05 +01:00
Kevin Redon 4cd3f7d163 add SERCOM peripheral for UART debug
currently only the SERCOM peripheral driver is added an configured,
but it is not being used.
UART debug will be done through the EDBG COM port, on PB24/PB25 of
SAM E54 Xplained Pro board

Change-Id: Id7af37ce1dd2d0a356e019c96bf6438ce459411b
2019-02-07 15:56:05 +01:00
Kevin Redon 69b92d91f7 start with USB CDC echo example
this is the Atmel START USB CDC Echo example project for the
SAM E54 Xplained Pro board using an Atmel ATSAME54P20A
microcontroller.
Atmel START information:
- Version: 1.4.1810 (Dec 18, 2018, 5:52 AM GMT+1)
- Server: 1.4.93
- Content version: 1.0.1340

This will serve as basis for the sysmoOCTSIM project

A jenkins contrib script has also been added to the
osmo-ccid-firmware project to build the sysmoOCTSIM firmware

Change-Id: I356de75e7b730d63fb819248e71d36f785932199
2019-02-07 15:54:56 +01:00