-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
223 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: © 2023 Jinwoo Park ([email protected]) | ||
SPDX-License-Identifier: MIT OR Apache-2.0 | ||
--> | ||
|
||
# Dependency Injection for card reader | ||
To build with NDA features (GPARK Limited or own secret dependency), need adding following command on each `cargo` command. | ||
build, run or any other `cargo` command. | ||
|
||
```sh | ||
# dependency injection from git repository | ||
# CAUTION , this should be work but not working | ||
--config "patch.'https://github.com/pmnxis/billmock-app-rs.git'.serial-arcade-pay-impl.git = \"https://github.com/user_name/repo_name.git\"" | ||
|
||
# dependency injection from local repository | ||
# this works | ||
--config "patch.'https://github.com/pmnxis/billmock-app-rs.git'.serial-arcade-pay-impl.path = \"../repo_name\"" | ||
``` | ||
|
||
In this repository, experimentally utilize dependency injection that the 'patch' function of 'cargo' to coexist both NDA code and open source example code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: © 2023 Jinwoo Park ([email protected]) | ||
SPDX-License-Identifier: MIT OR Apache-2.0 | ||
--> | ||
|
||
# Develop Environment | ||
|
||
_※ It might available with Windows, but in this document only consider Debian-Linux._ | ||
|
||
### apply USB (stlink-v2/3) permission rule to ignore root access | ||
```sh | ||
# refer https://calinradoni.github.io/pages/200616-non-root-access-usb.html | ||
sudo tee /etc/udev/rules.d/70-st-link.rules > /dev/null <<'EOF' | ||
# ST-LINK V2 | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv2_%n" | ||
# ST-LINK V2.1 | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv2-1_%n" | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv2-1_%n" | ||
# ST-LINK V3 | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv3loader_%n" | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv3_%n" | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv3_%n" | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", GROUP="plugdev", MODE="660", TAG+="uaccess", SYMLINK+="stlinkv3_%n" | ||
EOF | ||
``` | ||
|
||
### apply rules and reboot linux | ||
```sh | ||
sudo usermod -a -G plugdev $USER | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger | ||
sudo reboot | ||
``` | ||
|
||
### Necessary apt package for rust embedded | ||
```sh | ||
# necessary for basic software development environment | ||
sudo apt install curl git build-essential -y | ||
# build.rs uses libgit2-sys to get commit hash | ||
sudo apt install pkg-config libssl-dev -y | ||
# for knurling-rs/probe-run | ||
sudo apt install libusb-1.0-0-dev libudev-dev -y | ||
|
||
# Install rustc/rustup/cargo for rust development environment | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
|
||
# Install probe-run for debug/flash firmware binary on target board. | ||
cargo install probe-run | ||
|
||
# Install cargo-binutils for analyze mem/flash usage. | ||
cargo install cargo-binutils | ||
rustup component add llvm-tools-preview | ||
``` | ||
|
||
### Build | ||
```sh | ||
cargo build | ||
``` | ||
|
||
```sh | ||
pmnxis@lmabdaDeb ~/Develop/billmock-app-rs master cargo build | ||
info: syncing channel updates for 'nightly-2023-08-24-x86_64-unknown-linux-gnu' | ||
info: latest update on 2023-08-24, rust version 1.74.0-nightly (249595b75 2023-08-23) | ||
info: downloading component 'cargo' | ||
info: downloading component 'clippy' | ||
info: downloading component 'llvm-tools' | ||
info: downloading component 'rust-docs' | ||
info: downloading component 'rust-src' | ||
info: downloading component 'rust-std' for 'thumbv6m-none-eabi' | ||
info: downloading component 'rust-std' | ||
info: downloading component 'rustc' | ||
info: downloading component 'rustfmt' | ||
info: installing component 'cargo' | ||
info: installing component 'clippy' | ||
info: installing component 'llvm-tools' | ||
info: installing component 'rust-docs' | ||
info: installing component 'rust-src' | ||
info: installing component 'rust-std' for 'thumbv6m-none-eabi' | ||
info: installing component 'rust-std' | ||
info: installing component 'rustc' | ||
info: installing component 'rustfmt' | ||
Updating crates.io index | ||
Updating git repository `https://github.com/embassy-rs/embassy.git` | ||
``` | ||
|
||
### Cargo Run | ||
```sh | ||
pmnxis@lmabdaDeb ~/Develop/billmock-app-rs master cargo run | ||
Finished dev [optimized + debuginfo] target(s) in 0.06s | ||
Running `probe-run --chip STM32G030C8Tx --log-format '{t} [{L}][ {f}:{l} ] {s}' target/thumbv6m-none-eabi/debug/billmock-app-rs` | ||
(HOST) INFO flashing program (45 pages / 45.00 KiB) | ||
(HOST) INFO success! | ||
──────────────────────────────────────────────────────────────────────────────── | ||
0.000000 [DEBUG][ fmt.rs:130 ] rcc: Clocks { sys: Hertz(16000000), apb1: Hertz(16000000), apb1_tim: Hertz(16000000), ahb1: Hertz(16000000) } | ||
+-----------------------------------------------------------+ | ||
Firmware Ver : billmock-app-rs 0.1.2 | ||
Git Hash : bf976acd38633f7204e9423def8b5b062e0a0ad3 | ||
Git Datetime : 2023-09-17 20:55:10 +0900 | bf976ac | ||
+-----------------------------------------------------------+ | ||
0.004272 [TRACE][ fmt.rs:117 ] USART: presc=1, div=0x0000008b (mantissa = 8, fraction = 11) | ||
0.004638 [TRACE][ fmt.rs:117 ] Using 16 bit oversampling, desired baudrate: 115200, actual baudrate: 115107 | ||
1.006286 [WARN ][ serial_device.rs:156 ] The module use a example library. It may not work in real fields. | ||
OUT[ LED2-Indicator] : Low | ||
OUT[ LED1-Indicator] : Low | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: © 2023 Jinwoo Park ([email protected]) | ||
SPDX-License-Identifier: MIT OR Apache-2.0 | ||
--> | ||
|
||
# Hardware | ||
|
||
![Actual BillMock PCB 0v4](https://billmock.gpark.biz/images/BillMockPCB_0v4.jpg) | ||
|
||
There are currently four hardware revisions available: 0.2, 0.3, 0.4, and 0.4 Mini. Development is being carried out specifically for the 0.4 and 0.4 Mini revisions, which are the ones that are actually usable. | ||
|
||
To check pin mappings or installation details, please refer to the desired section in the table of contents on the left. | ||
|
||
For detailed hardware schematics, you can refer to [BillMock-HW-RELEASE](https://github.com/pmnxis/BillMock-HW-RELEASE). | ||
|
||
## Hardware design | ||
BillMock hardware schematic repository (only pdf) : [BillMock Hardware PDF Release](https://github.com/pmnxis/BillMock-HW-RELEASE) | ||
|
||
The schematic printed in PDF is distributed under CC BY-SA 3.0, but the actual Gerber files and project files are private. | ||
|
||
#### v 0.4 Mini (2023-09-12 or 2023-09-13) | ||
[BillMock-Mini-HW-0v4.pdf](https://github.com/pmnxis/BillMock-HW-RELEASE/blob/master/sch//BillMock-Mini-HW-0v4.pdf) | ||
|
||
#### v 0.4 (2023-09-08) | ||
[BillMock-HW-0v4.pdf](https://github.com/pmnxis/BillMock-HW-RELEASE/blob/master/sch/BillMock-HW-0v4.pdf) | ||
|
||
#### ~~v 0.3 (2023-08-11)~~ - DEPRECATED | ||
~~[BillMock-HW-0v3.pdf](https://github.com/pmnxis/BillMock-HW-RELEASE/blob/master/sch/BillMock-HW-0v3.pdf)~~ | ||
|
||
#### ~~v 0.2 (2023-06-13)~~ - DEPRECATED | ||
~~[BillMock-HW-0v2.pdf](https://github.com/pmnxis/BillMock-HW-RELEASE/blob/master/sch/BillMock-HW-0v2.pdf)~~ | ||
|
||
# Hardware License Information | ||
|
||
The original data for the circuit diagram is under a private license, but the PDF schematic is distributed under the CC-BY-SA 3.0 license. Therefore, data such as gerbers and the Bill of Materials (BOM) used in production will not be disclosed at all. Additionally, circuits created based on this schematic (PDF) must adhere to the following conditions: | ||
|
||
Please provide proper attribution when using it for commercial purposes. | ||
|
||
- Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. | ||
|
||
- ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. | ||
|
||
Translation Note: This text appears to describe the licensing terms and conditions related to the hardware, particularly regarding the use of schematic data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: © 2023 Jinwoo Park ([email protected]) | ||
SPDX-License-Identifier: MIT OR Apache-2.0 | ||
--> | ||
|
||
# Software | ||
|
||
## Card Terminal Connectivity in actual environment | ||
The firmware being developed is based on KICC's ED-785 terminal for mass production. However, in accordance with the NDA agreement, the code related to this is not present in the public codebase. Instead, it is managed separately through dependency injection. Therefore, the publicly available source code contains only example protocol code that does not actually perform any real operations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: © 2023 Jinwoo Park ([email protected]) | ||
SPDX-License-Identifier: MIT OR Apache-2.0 | ||
--> | ||
|
||
# 개발자 매뉴얼 | ||
|
||
# Write In Rust | ||
Used rust experimentally. | ||
|
||
This repository is aiming three goal. | ||
One for development of production firmware and second is making a proof of concept that rust embedded is usable for actual embedded production. And last goal is setting some example about production-rust-embedded-code. | ||
|
||
The software code is in [billmock-app-rs](https://github.com/pmnxis/billmock-app-rs) , except NDA related code. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters