(Including Demo videos at end of the description)
Due to the pandemic in the past few years, lacking chips became one of the reasons that vendors cannot produce products. That affects industry, automotive and IT, etc. In addition, many countries propose new policies/acts which start to investigate the source of products recently. Therefore, keeping the flexibility of the usage of parts to maintain the robustness of productivity and service is an important skill. This talk will list the toolchains & debug tools for common chip architectures and share some development experience.
This talk will share how to use the open source toolchain and debug tools to develop and debug, then flash the program to the ARM Cortex-M development board. The same idea can be used on other chip’s development boards. Will have some examples for ARM Cortex-A and RISC-V 32 & 64 Bits environment. Besides, will share the experience of sending patches to the debug tool and co-working with upstream, too.
Demo Videos:
* Develop with Nuvoton's NuTiny-SDK-NUC472 https://www.youtube.com/watch?v=Yz9uw2_9KS8
* Develop with Longan Nano https://www.youtube.com/watch?v=IFqDM_GLUfo
* Boot Custom Linux Image on Raspberry Pi 4B https://www.youtube.com/watch?v=t3PjTtf5MvU
* Boot Linux on QEMU RISC-V 64 Bits VM https://www.youtube.com/watch?v=8c7zfvJYzSo
* Develop with Arduino Nano https://www.youtube.com/watch?v=sU7X9Q35hhY
The promise of the IoT won’t be fulfilled until integrated
software platforms are available that allow software
developers to develop these devices efficiently and in
the most cost-effective manner possible.
This presentation introduces F9 microkernel, new open source
implementation built from scratch, which deploys
modern kernel techniques dedicated to deeply
embedded devices.
It is the presentation file used by Jim Huang (jserv) at OSDC.tw 2009. New compiler technologies are invisible but highly integrated around our world, and we can enrich the experience via facilitating LLVM.
Linux uses /proc/iomem as a "Rosetta Stone" to establish relationships between software and hardware. /proc/iomem maps physical memory addresses to devices, similar to how the Rosetta Stone helped map Egyptian hieroglyphs to Greek and decode ancient Egyptian texts. This virtual file allows the kernel to interface with devices by providing address translations between physical and virtual memory spaces.
The document summarizes the use of LLVM for code generation when recompiling Nintendo games as native games. LLVM provides a full compiler infrastructure that can be used to generate code for various platforms from a common intermediate representation (LLVM bitcode). The document discusses using LLVM for code generation from 6502 assembly to generate native code for emulation. Optimizations available through LLVM are also discussed.
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
https://coscup.org/2021/en/session/39M73K
https://www.youtube.com/watch?v=L_Gyvdl_d_k
Engineers have plenty of debug tools for user space programs development, code tracing, debugging and analyzing. Except “printk”, do we have any other debug tools for Linux kernel development? The “KGDB” mentioned in Linux kernel document provides another possibility.
Will share how to experiment with the KGDB in a virtual machine. And, use GDB + OpenOCD + JTAG + Raspberry Pi in the real environment as the demo in this talk.
開發 user space 軟體時,工程師們有方便的 debug 工具進行查找、分析、除錯。但在 Linux kernel 的開發,除了 printk 外,還可以有哪些工具可以使用呢?從 Linux kernel document 可以看到 KGDB 相關的資訊,提供了在 kernel 除錯時的另一個可能性。
本次將分享,從建立最簡單環境的虛擬機機開始,到實際使用 GDB + OpenOCD + JTAG + Raspberry Pi 當作展示範例。
The promise of the IoT won’t be fulfilled until integrated
software platforms are available that allow software
developers to develop these devices efficiently and in
the most cost-effective manner possible.
This presentation introduces F9 microkernel, new open source
implementation built from scratch, which deploys
modern kernel techniques dedicated to deeply
embedded devices.
It is the presentation file used by Jim Huang (jserv) at OSDC.tw 2009. New compiler technologies are invisible but highly integrated around our world, and we can enrich the experience via facilitating LLVM.
Linux uses /proc/iomem as a "Rosetta Stone" to establish relationships between software and hardware. /proc/iomem maps physical memory addresses to devices, similar to how the Rosetta Stone helped map Egyptian hieroglyphs to Greek and decode ancient Egyptian texts. This virtual file allows the kernel to interface with devices by providing address translations between physical and virtual memory spaces.
The document summarizes the use of LLVM for code generation when recompiling Nintendo games as native games. LLVM provides a full compiler infrastructure that can be used to generate code for various platforms from a common intermediate representation (LLVM bitcode). The document discusses using LLVM for code generation from 6502 assembly to generate native code for emulation. Optimizations available through LLVM are also discussed.
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
https://coscup.org/2021/en/session/39M73K
https://www.youtube.com/watch?v=L_Gyvdl_d_k
Engineers have plenty of debug tools for user space programs development, code tracing, debugging and analyzing. Except “printk”, do we have any other debug tools for Linux kernel development? The “KGDB” mentioned in Linux kernel document provides another possibility.
Will share how to experiment with the KGDB in a virtual machine. And, use GDB + OpenOCD + JTAG + Raspberry Pi in the real environment as the demo in this talk.
開發 user space 軟體時,工程師們有方便的 debug 工具進行查找、分析、除錯。但在 Linux kernel 的開發,除了 printk 外,還可以有哪些工具可以使用呢?從 Linux kernel document 可以看到 KGDB 相關的資訊,提供了在 kernel 除錯時的另一個可能性。
本次將分享,從建立最簡單環境的虛擬機機開始,到實際使用 GDB + OpenOCD + JTAG + Raspberry Pi 當作展示範例。
The document discusses QEMU and adding a new device to it. It begins with an introduction to QEMU and its uses. It then discusses setting up a development environment, compiling QEMU, and examples of existing devices. The main part explains how to add a new "Devix" device by creating source files, registering the device type, initializing PCI configuration, and registering memory regions. It demonstrates basic functionality like interrupts and I/O access callbacks. The goal is to introduce developing new emulated devices for QEMU.
GNU Toolchain is the de facto standard of IT industrial and has been improved by comprehensive open source contributions. In this session, it is expected to cover the mechanism of compiler driver, system interaction (take GNU/Linux for example), linker, C runtime library, and the related dynamic linker. Instead of analyzing the system design, the session is use case driven and illustrated progressively.
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)Mr. Vengineer
2016年2月20日(金)のZynq Ultrasclae+ MPSoC 勉強会で使った資料です。
追記) 2016.05.08
公式ARM Trusted Firmwareのサイトに、Zynq UltraScale+ MPSoCの実装が追加されていていることを明記した
This is the material I used at Zynq Ultrasclae + MPSoC SIG on 20th February (Friday).
Addendum) 2016.05.08
We stated that the implementation of Zynq UltraScale + MPSoC was added to the official ARM Trusted Firmware site.
The document discusses three sanitizers - AddressSanitizer, ThreadSanitizer, and MemorySanitizer - that detect bugs in C/C++ programs. AddressSanitizer detects memory errors like buffer overflows and use-after-frees. ThreadSanitizer finds data races between threads. MemorySanitizer identifies uses of uninitialized memory. The sanitizers work by instrumenting code at compile-time and providing a run-time library for error detection and reporting. They have found thousands of bugs in major software projects with reasonable overhead. Future work includes supporting more platforms and detecting additional classes of bugs.
LAS16-403 - GDB Linux Kernel Awareness Peter Griffin
The document discusses extending the GNU Debugger (GDB) to provide better Linux kernel debugging capabilities by adding "Linux awareness" features, including providing information about running tasks, loaded modules, and OS helper commands, and it describes the work by the ST Landing Team and Linaro Toolchain Working Group to upstream these extensions from the ST Linux Kernel Debugger (LKD) plugin into GDB.
LAS16-403: GDB Linux Kernel Awareness
Speakers: Peter Griffin
Date: September 29, 2016
★ Session Description ★
The presentation will look at the ways in which GDB can be enhanced when debugging the Linux kernel to give it better knowledge of the underlying operating system to enable a better debugging experience. It will also provide a status of the current work being undertaken in this area by the ST landing team, a demo and potential future work.
★ Resources ★
Etherpad: pad.linaro.org/p/las16-403
Presentations & Videos: http://connect.linaro.org/resource/las16/las16-403/
★ Event Details ★
Linaro Connect Las Vegas 2016 – #LAS16
September 26-30, 2016
http://www.linaro.org
http://connect.linaro.org
The document discusses QEMU and adding a new device to it. It begins with an introduction to QEMU and its uses. It then discusses setting up a development environment, compiling QEMU, and examples of existing devices. The main part explains how to add a new "Devix" device by creating source files, registering the device type, initializing PCI configuration, and registering memory regions. It demonstrates basic functionality like interrupts and I/O access callbacks. The goal is to introduce developing new emulated devices for QEMU.
GNU Toolchain is the de facto standard of IT industrial and has been improved by comprehensive open source contributions. In this session, it is expected to cover the mechanism of compiler driver, system interaction (take GNU/Linux for example), linker, C runtime library, and the related dynamic linker. Instead of analyzing the system design, the session is use case driven and illustrated progressively.
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)Mr. Vengineer
2016年2月20日(金)のZynq Ultrasclae+ MPSoC 勉強会で使った資料です。
追記) 2016.05.08
公式ARM Trusted Firmwareのサイトに、Zynq UltraScale+ MPSoCの実装が追加されていていることを明記した
This is the material I used at Zynq Ultrasclae + MPSoC SIG on 20th February (Friday).
Addendum) 2016.05.08
We stated that the implementation of Zynq UltraScale + MPSoC was added to the official ARM Trusted Firmware site.
The document discusses three sanitizers - AddressSanitizer, ThreadSanitizer, and MemorySanitizer - that detect bugs in C/C++ programs. AddressSanitizer detects memory errors like buffer overflows and use-after-frees. ThreadSanitizer finds data races between threads. MemorySanitizer identifies uses of uninitialized memory. The sanitizers work by instrumenting code at compile-time and providing a run-time library for error detection and reporting. They have found thousands of bugs in major software projects with reasonable overhead. Future work includes supporting more platforms and detecting additional classes of bugs.
LAS16-403 - GDB Linux Kernel Awareness Peter Griffin
The document discusses extending the GNU Debugger (GDB) to provide better Linux kernel debugging capabilities by adding "Linux awareness" features, including providing information about running tasks, loaded modules, and OS helper commands, and it describes the work by the ST Landing Team and Linaro Toolchain Working Group to upstream these extensions from the ST Linux Kernel Debugger (LKD) plugin into GDB.
LAS16-403: GDB Linux Kernel Awareness
Speakers: Peter Griffin
Date: September 29, 2016
★ Session Description ★
The presentation will look at the ways in which GDB can be enhanced when debugging the Linux kernel to give it better knowledge of the underlying operating system to enable a better debugging experience. It will also provide a status of the current work being undertaken in this area by the ST landing team, a demo and potential future work.
★ Resources ★
Etherpad: pad.linaro.org/p/las16-403
Presentations & Videos: http://connect.linaro.org/resource/las16/las16-403/
★ Event Details ★
Linaro Connect Las Vegas 2016 – #LAS16
September 26-30, 2016
http://www.linaro.org
http://connect.linaro.org
Tiny ML for spark Fun Edge
https://www.ittraining.com.tw/ittraining/it-elearning/el-ai/ai-tensorflow-lite-for-mcu
TensorFlow Lite for MCU正是專為邊緣裝置設計的TensorFlow模型預測框架,是TensorFlow的精簡版本,讓開發者可以在物聯網與嵌入式裝置中部署微型機器學習模型。 本課程將教授AI模型如何佈署於微控制器,包含模型訓練、模型最佳化以及TensorFlow Lite框架的程式開發等。此外,在實作上以Sparkfun edge board (ARM cortex M4)為例,說明如何以TensorFlow Lite 進行微控制器上面的人工智慧開發專案,包含人臉偵測、關鍵字的字詞偵測、姿態識別、異常偵測等。
This document discusses improving debugging of the Linux kernel using the open source debugger GDB. It begins with an overview of existing ways to debug the kernel using GDB, including via KGDB, Qemu, and JTAG probes like OpenOCD. It then discusses the concept of adding "Linux awareness" to GDB, which would allow it to better understand kernel concepts like threads and modules. Finally, it outlines three approaches to implementing this awareness: via a GDB scripting extension, in the GDB stub, or with a C extension to GDB. The overall goal is to make GDB a more full-featured and useful tool for kernel debugging.
Hardwear.io 2018 BLE Security Essentials workshopSlawomir Jasek
Bluetooth Low Energy (Smart, 4) is recently gaining more and more traction as one of the most common and rapidly growing IoT technologies. Unfortunatelly the prevalence of technology does not come with security. Alarming vulnerabilities in BLE smart locks, medical devices and banking tokens are revealed day by day. And yet, the knowledge on how to comprehensively assess them seems very uncommon.
In this workshop you will get familiar with the basics of BLE security. We will work on a dedicated, readily available BLE hardware nRF devkit device. You will learn how to program and flash it yourself, using special web interface and ready templates. Such approach allows to better understand how things work “under the hood”, experiment with different options, and then secure the hardware properly.
From attacker’s perspective, we will cover among others: sniffing, spoofing, MITM, replay and relay.
Having enough time, we will play with a collection of vulnerable smart locks, sex toys and other devices.
This document summarizes VPU and GPGPU computing technologies. It discusses that a VPU is a visual processing unit, also known as a GPU. GPUs have massively parallel architectures that allow them to perform better than CPUs for some complex computational tasks. The document then discusses GPU, PPU and GPGPU architectures, programming models like CUDA, and applications of GPGPU computing such as machine learning, robotics and scientific research.
This document summarizes VPU and GPGPU technologies. It discusses that a VPU is a visual processing unit, also known as a GPU. GPUs have massively parallel architectures that allow them to perform better than CPUs for some complex computational tasks. The document then discusses GPU architecture including stream processing, graphics pipelines, shaders, and GPU clusters. It provides an example of using CUDA for GPU computing and discusses how GPUs are used for general purpose computing through frameworks like CUDA.
This document summarizes VPU and GPGPU computing technologies. It discusses that a VPU is a visual processing unit, also known as a GPU. GPUs provide massively parallel and multithreaded processing capabilities. GPUs are now commonly used for general purpose computing due to their ability to handle complex computational tasks faster than CPUs in some cases. The document then discusses GPU and PPU architectures, programming models like CUDA, and applications of GPGPU computing such as machine learning, robotics, and scientific research.
The document discusses VPU and GPGPU computing. It explains that a VPU is a visual processing unit, also known as a GPU. GPUs are massively parallel and multithreaded processors that are better than CPUs for tasks like machine learning and graphics processing. The document then discusses GPU architecture, memory, and programming models like CUDA. It provides examples of GPU usage and concludes that GPGPU is used in fields like machine learning, robotics, and scientific computing.
The document discusses using an STM32F407VGT6 microcontroller with 168MHz Cortex-M4 CPU, 1MB flash, and 192KB RAM. It provides instructions for downloading toolchains, firmware, and debugging software to interface with the microcontroller via an onboard ST-LINK/V2 debugger over USB or JTAG. The STM32F4 Discovery board is highlighted as a development platform for experimenting with the microcontroller.
This document provides an introduction to eBPF and XDP. It discusses the history of BPF and how it evolved into eBPF. Key aspects of eBPF covered include the instruction set, JIT compilation, verifier, helper functions, and maps. XDP is introduced as a way to program the data plane using eBPF programs attached early in the receive path. Example use cases and performance benchmarks for XDP are also mentioned.
The document provides a manual for the UTFT library, which is a universal library for driving TFT displays from Arduino and other microcontroller boards. It supports many 8-bit, 16-bit, and serial graphic displays. The summary includes:
- The UTFT library supports various TFT displays and will work with Arduino, chipKit, and TI LaunchPads. It allows setting colors, drawing shapes, printing text, and more.
- Functions are provided for initializing displays, setting colors, clearing/filling screens, drawing pixels/lines/shapes, printing text and numbers, selecting fonts, and drawing bitmaps.
- The library includes predefined fonts and color values. Additional fonts can be
This document discusses the crash reporting mechanism in Tizen. It describes the crash client, which handles crash signals and generates crash reports. It covers Samsung's crash-work-sdk and Intel's corewatcher crash clients. It also discusses the crash server that receives reports and the CrashDB web interface. Finally, it mentions crash reason location algorithms.
You have one of those fruity *Pi arm boards and cheep sensor from China? Some buttons and LEDs? Do I really need to learn whole new scripting language and few web technologies to read my temperature, blink a led or toggle a relay? No, because your Linux kernel already has drivers for them and all you need is device tree and cat.
Embedded Recipes 2019 - Introduction to JTAG debuggingAnne Nicolas
This talk introduces JTAG debugging capabilities, both for debugging hardware and software. Marek first explains what the JTAG stands for and explains the operation of the JTAG state machine. This is followed by an introduction to free software JTAG tools, OpenOCD and urJTAG. Marek shortly explains how to debug software using those tools and how that ties into the JTAG state machine. However, JTAG was designed for testing hardware. Marek explains what boundary scan testing (BST) is, what are BSDL files and their format, and practically demonstrates how to blink an LED using BST and only free software tools.
Marek Vasut
"Session ID: SFO17-102
Session Name: Deploy STM32 family on Zephyr - SFO17-102
Speaker: Erwan Gouriou
Track: LITE
★ Session Summary ★
Objects:
-Quick intro on STM32 offer
-Strategy used to minimize code and maintenance effort and break silos
-Status on supported drivers
Slides:
-STM32 families and SoCs (highlight number of refs (>900) and need for mutualization)
-SoC naming conventions
-ST boards
-STM32Cube
-Initial deployment in Zephyr
-STM32Cube introduction and introduction in Zephyr
*HAL vs LL
*Information conveyed by CMSIS files
-Driver deployment strategy
*CMSIS (generic defines)
*LL/HAL
-Simplification brought by driver init code and pinmux generated by Device tree
---------------------------------------------------
★ Resources ★
Event Page: http://connect.linaro.org/resource/sfo17/sfo17-102/
Presentation:
Video:
---------------------------------------------------
★ Event Details ★
Linaro Connect San Francisco 2017 (SFO17)
25-29 September 2017
Hyatt Regency San Francisco Airport
---------------------------------------------------
Keyword:
http://www.linaro.org
http://connect.linaro.org
---------------------------------------------------
Follow us on Social Media
https://www.facebook.com/LinaroOrg
https://twitter.com/linaroorg
https://www.youtube.com/user/linaroorg?sub_confirmation=1
https://www.linkedin.com/company/1026961"
The document discusses challenges in GPU compilers. It begins with introductions and abbreviations. It then outlines the topics to be covered: a brief history of GPUs, what makes GPUs special, how to program GPUs, writing a GPU compiler including front-end, middle-end, and back-end aspects, and a few words about graphics. Key points are that GPUs are massively data-parallel, execute instructions in lockstep, and require supporting new language features like OpenCL as well as optimizing for and mapping to the GPU hardware architecture.
Hardware for deep learning includes CPUs, GPUs, FPGAs, and ASICs. CPUs are general purpose but support deep learning through instructions like AVX-512 and libraries. GPUs like NVIDIA and AMD models are commonly used due to high parallelism and memory bandwidth. FPGAs offer high efficiency but require specialized programming. ASICs like Google's TPU are customized for deep learning and provide high performance but limited flexibility. Emerging hardware aims to improve efficiency and better match neural network computations.
Not breaking userspace: the evolving Linux ABIAlison Chaiken
This document discusses not breaking userspace through maintaining the Linux application binary interface (ABI). It begins by defining what an ABI is and how it guarantees compatibility between userspace applications and the Linux kernel. It then discusses several examples where ABI breaks have occurred or may need to occur, such as for the 2038 time issue, priority inheritance in threading, and changes to tools like BPF programs. The document provides methods for avoiding ABI breaks, such as unused function parameters and exporting information to sysfs. It concludes that maintaining the ABI is important but also sometimes unavoidable when new features are needed.
Similar to Share the Experience of Using Embedded Development Board (20)
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Jian-Hong Pan
Flatpak is a framework for distributing desktop applications and supported by most of Linux distributions. This talk shares how to package a HTTP server written in Python as a Flatpak app. And, runs it like a desktop application by launching a browser connecting to the server automatically.
https://hackmd.io/@starnight/Have_an_HTTP_Server_in_Flatpak
Launch the First Process in Linux SystemJian-Hong Pan
The session: https://coscup.org/2022/en/session/AGCMDJ
After Linux kernel boots, it will try to launch first process “init” in User Space. Then, the system begins the featured journey of the Linux distribution.
This sharing takes Busybox as the example and shows that how does Linux kernel find the “init” which directs to the Busybox. And, what will Busybox do and how to get the console. Try to make it like a simple Linux system.
Before Linux kernel launches “init” process, the file system and storage corresponding drivers/modules must be loaded to find the “init”. Besides, to mount the root file system correctly, the kernel boot command must include the root device and file system format parameters.
On the other hand, the Busybox directed from “init” is a lightweight program, but has rich functions, just like a Swiss Army Knife. So, it is usually used on the simple environment, like embedded Linux system.
This sharing will have a demo on a virtual machine first, then on the Raspberry Pi.
Drafts:
* https://hackmd.io/@starnight/Busbox_as_the_init
* https://hackmd.io/@starnight/Build_Alpines_Root_Filesystem_Bootstrap
Relate idea: https://hackmd.io/@starnight/Systems_init_and_Containers_COMMAND_Dockerfiles_CMD
A Journey to Boot Linux on Raspberry PiJian-Hong Pan
Each processor/chip architecture has its own procedure to boot the kernel. It works with desgined partition layout and vendor specific firmwares/bootloaders in the boot partition. We can learn the related knowledge from the Raspbian image for Raspberry Pi, which is the board we can obtain easily. However, the diversity between the special booting procedures with specific firmwares/bootloaders increases the complexity for distribution maintainers. It will be great if there is a way to make it more generic that can be applied to most of the chip architectures/boards to boot up the system.
After referring to some Linux distributions, we learned U-Boot may play a role in the solution. It splits the booting procedure into hardware specific and generic system parts. This helps distribution maintainers deploy the generic system with OSTree, including device trees.
Let’s deep dive into this magic booting procedure!
The document discusses a simple MODBUS server, including specifications for MODBUS over serial and TCP/IP. It provides an overview of MODBUS client-server communication and function code 01 for reading coils. The presentation includes a demo of a MODBUS server and references specifications for the MODBUS application protocol.
Software Packaging for Cross OS DistributionJian-Hong Pan
The document discusses software packaging for cross-platform distribution by building Debian packages inside a container. It provides examples of building a simple "Hello World" package and modifying an existing "nvidia-graphics-drivers" package. It demonstrates setting up a Debian environment in a Docker container, creating packages without root privileges, and implementing packaging as infrastructure code using a Dockerfile. The document promotes open source and discusses using Podman instead of Docker for containerization.
Nasa Hackthon 2018 Light Wonder - Go! Polar Bear!Jian-Hong Pan
This document describes a data service for polar geographic information system (GIS) visualization. It discusses three potential features of the service including displaying the real GIS history of polar regions, modeling species and food chains, and showing environmental changes and impacts. It outlines the data requirements and sources, such as digital elevation models, sea level/ice data, and species distributions. It also discusses the challenges of working with open data, including inconsistent formats, missing data, and difficulties searching. The architecture would collect and convert open data sources into standardized formats to support audiences and inspire them through interactive polar visualizations.
This document discusses LoRaWAN class modules and subsystems for LoRa devices. It provides an overview of LoRa hardware, IEEE 802.15.4, and LoRaWAN class A, B and C. It also describes a class module that could implement an IEEE 802.15.4 MAC over the LoRa PHY and a subsystem for LoRa devices, as the IEEE 802.15.4 over LoRa PHY would not be compatible with original IEEE 802.15.4 devices.
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoTJian-Hong Pan
Video: https://www.youtube.com/watch?v=_lGN-LDyl2I
在萬物聯網的時代,透過通訊技術將量測到的物理量傳送到遠端伺服器是很一般的作法。但要這「通訊」如何達到低成本、符合使用情境的條件,仍然是個經典的問題。
特別是在需要長距離、低功耗與長生命週期的需求下,或許以 Low-Power Wide-Area Network (LPWAN) 為基礎的 LoRa 通訊技術是個不錯的選擇。
若是在程式底層的部份,將此基礎建設的通訊技術寫成個 LoRa 的 Linux Device Driver,一般使用者就可以單純專注在應用層面的開發、降低進入門檻。
這次將介紹如何寫出這 IEEE 802.15.4 MAC over LoRa PHY 的 Linux Device Driver。
期望經由此 driver 合併 IEEE 802.15.4 MAC 的 Cluster Tree Network topology 與 LoRa PHY 的 link budget 優勢,達到超大範圍的通訊覆蓋面積,以達到相關需求。
In the Internet of Things' era, transferring the measured physical values to the servers through the communication technology is the popular usage template. However, finding the lowest cost method that fulfills the usage scenarios, power issues and the real time requirements still is a classic engineering problem.
Under the long range and low power consumption for longer life cycle conditions, LoRa which is based on Low-Power Wide-Area Network (LPWAN) might be one of the good choices. Moreover, if it goes with a LoRa Linux device driver, general users can focus on the development of related upper layer applications.
This time, I will introduce how to write an IEEE 802.15.4 MAC over LoRa PHY Linux device driver and its architecture. Hope this approach will gain more benefits by combining both advantages: Cluster Tree Network of IEEE 802.15.4 MAC and the good link budget of LoRa PHY.
The Considerations for Internet of Things @ 2017Jian-Hong Pan
物聯網是一門透過通訊,將端點蒐集到的資料,集中關聯分析,並將分析結果用以決策並回饋的工程藝術。
本次的分享將從物聯網的目的當作進入點,接著分享可能的佈署架構。並概述目前各個常用的通訊標準、協定,以及其所屬的角色。
除此之外,也會分享去年到柏林參加Linux Foundation舉辦的Open IoT Summit Europe 2016的心得。
在此,帶回一些國外對於物聯網節點的佈署、更新或維護的看法、作法。
另外,也會分享一些物聯網可能需要考量的資訊安全議題。
IoT is a kind of engineering art, which analyzes the collected data from
the device nodes through the communication and has the result for the
decision making and feedback.
This sharing goes for the purpose of IoT and it's deployment structure.
Then, the slide introduces the most used communication standards or
protocols in IoT and their roles.
Besides, also shares what I have got from the Open IoT Summit Europe 2016
which was held by Linux Foundation in Berlin last year.
It introduces how will the device nodes be deployed, updated and maintained.
Finally, the slide provides some security issues that should be considered
in IoT.
Build a Micro HTTP Server for Embedded SystemJian-Hong Pan
Apache HTTP Server, NGINX .. are famous web servers in the world. More and more web server frameworks come and follow up, like Node.js, Bottle of Python .., etc. All of them make us have the abilities to get or connect to the resources behind the web server. However, considering the limitations and portability, they may not be ported directly to the embedded system which has restricted resources. Therefore, we need to re-implement an HTTP server to fulfill that requirement.
I will introduce how do I use the convenience of Python to implement a Micro HTTP Server prototype according to RFC 2616/HTTP 1.1. Then, re-write the codes in C to build the Micro HTTP Server and do the automated testing with Python Unit Testing Framework. Finally, I combined the Micro HTTP Server with an RTOS and light the LEDs on an STM32F4-Discovery board.
Micro HTTP Server Implemented in C @ COSCUP 2016Jian-Hong Pan
The document discusses implementing a micro HTTP server in C for use on an embedded system with limited resources. It provides an overview of HTTP protocol basics including requests, responses, headers and bodies. It then discusses challenges of implementing an HTTP server on resource-constrained embedded devices and introduces approaches like using I/O multiplexing to handle requests from multiple clients concurrently without threads. The document proposes implementing a micro HTTP server in C using these techniques to run on an embedded system and real-time operating system.
The document discusses binding Python and C to create C extensions for Python 3. It covers the key steps: including Python headers, declaring C functions, defining a mapping of functions to Python methods, defining the Python module, and implementing an initialization function. Examples are provided for functions without arguments, with passed arguments, and returning variables. Differences between Python 2 and 3 bindings are that Python 3 uses a module definition structure and PyInit_ initialization while Python 2 uses an init_ initialization.
This document discusses load and stress testing web applications using Apache JMeter. It provides an overview of identifying bottlenecks in a system, how HTTP requests and responses work, and how to use Apache JMeter to perform load and stress tests. Key features of JMeter like installing it, creating test plans, running tests, and viewing results are described. The document also covers more advanced JMeter functions such as using variables, parsing responses, and running tests from the command line using Apache Ant.
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevJian-Hong Pan
This document provides an overview of how to configure GPIO pins on an STM32F4 microcontroller. It begins with the speaker's background and experience with ARM embedded systems. It then discusses the GPIO block of the STM32F4 chip and shows code from an example blinky project that initializes GPIO pins to blink LEDs. The document explains where the GPIO API definitions are located in the STM32F4 header files and library. It provides details on configuring GPIO pins for input or output modes. Finally, it summarizes the key GPIO registers used to configure the pin modes and states.
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code MeetupJian-Hong Pan
The document introduces several tools for debugging C/C++ programs within a terminal environment, including vimGdb, clewn, pyclewn, Conque GDB, and cgdb. It recommends cgdb as the best option, describing it as a lightweight curses-based interface that splits the screen to simultaneously display source code and the GNU Debugger terminal.
Make Your Own Developement Board @ 2014.4.21 JuluOSDevJian-Hong Pan
This document discusses building a development board for an ATMega8 microcontroller that functions as a simple oscilloscope. It outlines meeting specifications, minimizing costs, and completing the project in the shortest time as the core engineering values. It provides the specifications for the oscilloscope, discusses using AVR microcontroller features to implement it, and lists the tools needed including an AVR compiler and programmer. Circuits for a function generator and integrating the oscilloscope with a Python console are presented. The document emphasizes applying knowledge from school to implementation and building your own tools.
The Simple Scheduler in Embedded System @ OSDC.TW 2014Jian-Hong Pan
The document describes a simple scheduler module implemented in C for embedded systems. It breaks processes into small jobs represented by functions that are scheduled in a first-in, first-out queue without preemption. This allows embedding an operating system concept into simple systems using only functions and a ready queue. Interrupts can add jobs to the queue. The scheduler and example oscilloscope application demonstrate scheduling without process state using only callbacks.
Node.js is a server-side JavaScript platform for building scalable network applications. It allows writing code using JavaScript for non-browser environments like servers. Node.js uses an event-driven, asynchronous I/O model that makes it lightweight and efficient. A simple web server can be written in just a few lines of Node.js code. Node.js has a thriving ecosystem of external modules that help build full-stack JavaScript applications.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Share the Experience of Using Embedded Development Board
1. Share the Experience of
Using Embedded
Development Board
潘建宏 Jian-Hong Pan (StarNight)
@ COSCUP 2023
2. Who am I
潘建宏 / Jian-Hong Pan (StarNight)
Endless OS Foundation
You can find me at
● http://www.slideshare.net/chienhungpan/
● GitHub: starnight
● Twitter: starnight_pan
● Email:
jhp [AT] endlessos.org
chienhung.pan [AT] gmail.com
3. Background
● Due to the pandemic in the past few years, lacking chips has become one of
the reasons that vendors cannot produce products. That affects industry,
automotive and IT, etc.
● Many countries propose new policies/acts which start to investigate the
source of products recently.
Therefore, keeping the flexibility of the usage of parts to maintain the robustness
of productivity and service is an important skill.
4. Well-Known Chip Architectures
Including MCU and CPU
● PIC
● x86(_64)
● ARM (8, 32 and 64 bits)
● AVR (8 and 32 bits)
● RISC-V (32, 64 bits and …)
● … and more
5. Development Environment
Common
GCC, GDB, make … or known as toolchain
Embedded system
OpenOCD, JTAG, USB to serial (option) and Board Support Package (BSP)
Cross Compiler
{arch}-{project …}-{gcc, gdb, ld, objcopy, objdump …}
Host (x86_64)
Cross compile
source code
Target (ARM, RISC-V)
Executable binary
6. Examples
Microcontroller Unit (MCU) Level
● Cortex-M4: Nuvoton’s NuTiny-SDK-NUC472
● RISC-V (32 bits): Sipeed Longan Nano
Central Processor Unit (CPU) Level
● Cortex-A72: Raspberry Pi 4B
● RISC-V (64 bits): QEMU Virtual Machine
8. ARM Cortex-M Comparison
Arm Core Cortex-M0 … Cortex-M4 … Cortex-M23 …
ARM architecture ARMv6-M ARMv7E-M
ARMv8-M
Baseline
Instruction pipeline 3 stages 3 stages 2 stages
Multiply instructions
32x32 = 32-bit result
Yes
Multiply instructions
32x32 = 64-bit result
No Yes No
Divide instructions
32/32 = 32-bit quotient
No Yes
DSP instructions No Yes NO
TrustZone security instructions No No Optional
Reference: Table: ARM Cortex-M instruction variations of ARM Cortex-M
9. NuTiny-SDK-NUC472’s Dev Environment
My host is an Arch Linux (x86_64) system. The target chip is Nuvoton's
NUC472HI8AE, an ARM Cortex-M4 MCU. Therefore, install the “arm-none-eabi-”
toolchain packages:
● arm-none-eabi-binutils
● arm-none-eabi-gcc
● arm-none-eabi-newlib
● arm-none-eabi-gdb
I prefer the Makefile tool. So, make is installed, too.
Note: Nuvoton marks NUC472HI8AE as Not Recommended For New Designs
(NRND) now. Recommended Part Number: M487 Ethernet Series
10. NuTiny-SDK-NUC472 Dev Environment (cont.)
Also, need OpenOCD to flash and debug.
● Upstream OpenOCD must includes these commits at least:
○ flash/nor/numicro: reorder the parts list
○ flash: support Nuvoton M541 & NUC442/472 series
○ tcl: add a configuration file for Nuvoton M541 & NUC442/472 series
The commits have been merged into the master branch.
● Or, downstream Nuvoton OpenOCD
I use this one
12. NUC472-NuTiny’s LED Sample as the Example
Nuvoton has provided the NUC472/442 BSP at
https://github.com/OpenNuvoton/NUC472_442BSP, which follows Common
Microcontroller Software Interface Standard (CMSIS).
$ git clone https://github.com/OpenNuvoton/NUC472_442BSP
$ cd NUC472_442BSP/SampleCode/NUC472-NuTiny/LED/
And, have to add a Makefile into the LED sample code directory, for compile,
clean and flash.
13. CMSIS, Standard and Device Libraries for the Makefile
NUC472/442 BSP provides the libraries:
● CMSIS library is under path Library/CMSIS.
● Standard library is under path Library/StdDriver.
● NUC472/442’s library is under path Library/Device/Nuvoton/NUC472_442.
● NUC472/442’s system clock initialization is at
Library/Device/Nuvoton/NUC472_442/Source/system_NUC472_442.c.
● NUC472/442’s startup file is at
Library/Device/Nuvoton/NUC472_442/Source/GCC/startup_NUC472_442.S.
● NUC472/442’s linker file is at
Library/Device/Nuvoton/NUC472_442/Source/GCC/gcc_arm.ld.
14. Build the LED Application with make
$ make
arm-none-eabi-gcc -I../../../../NUC472_442BSP/Library/CMSIS/Include
-I../../../../NUC472_442BSP/Library/StdDriver/inc
-I../../../../NUC472_442BSP/Library/Device/Nuvoton/NUC472_442/Include -I. -ggdb -Os -Wall -Wextra
-Warray-bounds -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=hard
-mfpu=fpv4-sp-d16
-T../../../../NUC472_442BSP/Library/Device/Nuvoton/NUC472_442/Source/GCC/gcc_arm.ld main.c
../../../../NUC472_442BSP/Library/StdDriver/src/clk.c
../../../../NUC472_442BSP/Library/StdDriver/src/gpio.c
../../../../NUC472_442BSP/Library/StdDriver/src/sys.c
../../../../NUC472_442BSP/Library/Device/Nuvoton/NUC472_442/Source/system_NUC472_442.c
../../../../NUC472_442BSP/Library/Device/Nuvoton/NUC472_442/Source/GCC/startup_NUC472_442.S -o
LED.elf
...
arm-none-eabi-objcopy -O ihex LED.elf LED.hex
arm-none-eabi-objcopy -O binary LED.elf LED.bin
15. Flash the built image into NuTiny-SDK-NUC472
Connect the NuTiny-SDK-NUC472 to your host via the USB cable. And, flash:
$ make flash # May need root privilege for opening Nu-Link device
openocd -f "interface/nulink.cfg" -f "target/numicro_m4.cfg" -c "program LED.elf verify reset exit"
…
** Programming Started **
Info : Device ID: 0x00047201
Info : Device Name: NUC472HI8AE
Info : bank base = 0x00000000, size = 0x00080000
Warn : Adding extra erase range, 0x00001770 .. 0x000017ff
Info : Nuvoton NuMicro: Sector Erase ... (0 to 2)
Info : Nuvoton NuMicro: Flash Write ...
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
After flash, the onboard LED should become blinking.
16. Flash & Debug with GDB via OpenOCD and Nu-Link
Host
OpenOCD
Built Binary
Target Machine
NuTiny-EVB-NUC472
Nu-Link-Me
as the JTAG
17. 1. Start the gdb server with Nu-Link and the numicro M4 configs:
$ openocd -f "interface/nulink.cfg" -f "target/numicro_m4.cfg"
…
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain
JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : Nu-Link firmware_version 6535, product_id (0x00012009)
Info : Adapter is Nu-Link
Info : IDCODE: 0x2BA01477
Info : [NuMicro.cpu] Cortex-M4 r0p1 processor detected
Info : [NuMicro.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for NuMicro.cpu on 3333
Info : Listening on port 3333 for gdb connections
[NuMicro.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0x01000000 pc: 0x00000f5c msp: 0x20010000
18. 2. Have the gdb client connecting to the gdb server listening on port 3333 to
debug the LED.elf flashed on the MCU chip Nuvoton NUC472HI8AE:
$ arm-none-eabi-gdb LED.elf
...
Reading symbols from LED.elf...
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: Overlapping regions in memory map: ignoring
Reset_Handler () at
../../../../NUC472_442BSP/Library/Device/Nuvoton/NUC472_442/Source/GCC/startup_NUC472_442.S:268
268 ldr r1, =__etext
(gdb) hbreak main.c:86
Hardware assisted breakpoint 1 at 0x3a2: file main.c, line 86.
(gdb) continue
Continuing.
Breakpoint 1, main () at main.c:86
86 PB10 = 0;
(gdb)
Use hbreak (hardware-assisted breakpoint) to add a break point, instead of break.
Reference: 5.1.1 Setting Breakpoints
19. RISC-V Capability, RISC-V@Andes as the Example
AndeStar™ V5 Architecture:
● Supports both 32-bits (RV32) and 64-bits (RV64)
● 32-bit N25, N25F, D25F, A25 and A27;
64-bit NX25, NX25F, AX25, and AX27
● N25F, NX25F, A25 and AX25 supports single and double precision floating
point for high-precision data computations
● D25F, A25 and AX25 supports DSP/SIMD instructions
Reference: RISC-V@Andes
20. Sipeed Longan Nano's Dev Environment
According to Longan Nano’s introduction, the target chip is a GD32VF103 MCU
using Andes’ core with RISC-V 32 bits ISA. Therefore, install the “riscv64-elf-”
toolchain packages:
● riscv64-elf-binutils
● riscv64-elf-gcc
● riscv64-elf-newlib
● riscv64-elf-gdb
The make is a preferred tool and need OpenOCD to flash and debug.
21. List riscv64-elf- Toolchain Supported Architectures
$ riscv64-elf-gcc --version | head -n1
riscv64-elf-gcc (Arch Linux Repositories) 12.2.0
$ riscv64-elf-gcc --print-multi-lib
.;
rv32i/ilp32;@march=rv32i@mabi=ilp32
rv32im/ilp32;@march=rv32im@mabi=ilp32
rv32iac/ilp32;@march=rv32iac@mabi=ilp32
rv32imac/ilp32;@march=rv32imac@mabi=ilp32
rv32imafc/ilp32f;@march=rv32imafc@mabi=ilp32f
rv64imac/lp64;@march=rv64imac@mabi=lp64
rv64imafdc/lp64d;@march=rv64imafdc@mabi=lp64d
22. Tweak Longan Nano’s BSP
GD32VF103 Microcontroller has GD32VF103_Firmware_Library. However, it
suggests Nuclei SDK!?
$ git clone https://github.com/Nuclei-Software/nuclei-sdk
$ cd nuclei-sdk
I have some modification to use the bare-metal toolchain “riscv64-elf-”:
● Use common RISC-V 64 bare-metal toolchain
● Set ISA spec version as 2.2 to support extension zicsr
● Use mainline OpenOCD’s gd32vf103.cfg as the config. Besides, I use FTDI
FT232HQ board as the the JTAG interface. So, use um232h.cfg as the config.
23. Have an LED Application as the Example
Add the LED application referring to sibling helloworld:
$ ls application/baremetal/led/
main.c Makefile npk.yml
1. Get into the led app:
$ cd application/baremetal/led
2. Disable the optimization for GDB with -O0.
3. Build:
$ make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano all
4. Flash:
$ make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano upload
5. It will light RGB LEDs in order periodically.
24. Flash & Debug with GDB via OpenOCD and FTDI
Host
OpenOCD
Built Binary
Target Machine
Sipeed Longan Nano
FTDI FT232H
as the JTAG
26. 1. Connect the TCK, TDO, TDI, TMS and GND pins between FT232H and the
Sipeed Longan Nano board.
2. Start the gdb server with FT232H as JTAG interface and GD32VF103 as the
target configs:
$ openocd -f interface/ftdi/um232h.cfg -f target/gd32vf103.cfg
…
Warn : An adapter speed is not selected in the init scripts. OpenOCD will try to run the adapter at the low
speed (100 kHz)
Warn : To remove this warnings and achieve reasonable communication speed with the target, set
"adapter speed" or "jtag_rclk" in the init scripts.
Info : clock speed 100 kHz
Info : JTAG tap: gd32vf103.cpu tap/device found: 0x1000563d (mfg: 0x31e (Andes Technology
Corporation), part: 0x0005, ver: 0x1)
Info : JTAG tap: auto0.tap tap/device found: 0x790007a3 (mfg: 0x3d1 (GigaDevice Semiconductor
(Beijing) Inc), part: 0x9000, ver: 0x7)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 5 -expected-id 0x790007a3"
Info : datacount=4 progbufsize=2
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40901105
Info : starting gdb server for gd32vf103.cpu on 3333
Info : Listening on port 3333 for gdb connections
27. 3. Have the gdb client connecting to the gdb server to debug the led.elf flashed
on the MCU chip GD32VF103C8T6:
$ riscv64-elf-gdb led.elf
...
Reading symbols from led.elf...
(gdb) target extended-remote localhost:3333
Remote debugging using localhost:3333
0x080016ee in SysTimer_GetLoadValue ()
at ../../../NMSIS/Core/Include/core_feature_timer.h:151
151 if (high0 != high) {
(gdb) break main.c:68
Breakpoint 1 at 0x8001d9c: file main.c, line 68.
Note: automatically using hardware breakpoints for read-only addresses.
(gdb) continue
Continuing.
Breakpoint 1, main () at main.c:68
68 gpio_bit_reset(GPIOC, GPIO_PIN_13);
(gdb)
30. Build Linux Kernel with arm64 Arch
The cross compilation toolchain’s prefix is “aarch64-linux-gnu-”. Use
aarch64-linux-gnu-gcc as the compiler.
1. Get Linux kernel
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
2. Build
$ cd linux
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
31. Have a Blank Disk to Boot QEMU VM
$ fdisk -l blank.img
Disk blank.img: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf80638ed
Device Boot Start End Sectors Size Id Type
blank.img1 * 1 2049 2049 1M b W95 FAT32
blank.img2 2050 8191 6142 3M 83 Linux
Just a quick test!
32. Boot the QEMU VM with Linux Kernel & Blank Disk
Install packages: qemu-system-aarch64
$ qemu-system-aarch64
-smp 2
-M virt -cpu cortex-a57
-m 1G
-kernel ~/linux/arch/arm64/boot/Image
--append "console=ttyAMA0 root=/dev/vda2"
-hda ~/qemuimg/blank.img
-serial stdio
33. Linux Kernel Tries to Find init in the Filesystem
…
[ 2.146201] Run /sbin/init as init process
[ 2.148061] Run /etc/init as init process
[ 2.149846] Run /bin/init as init process
[ 2.150521] Run /bin/sh as init process
[ 2.151871] Kernel panic - not syncing: No working init found. Try passing init=
option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
…
34. The Init Process
In Unix-based computer operating systems, init (short for initialization) is the first
process started during booting of the computer system. Init is a daemon process
that continues running until the system is shut down. ~ from init on Wiki
● SysVInit
● Upstart
● Systemd
● OpenRC
● …
● Busybox
$ ls -l /bin/init # on my laptop
lrwxrwxrwx 1 root root 22 Jun 20 05:41 /bin/init -> ../lib/systemd/systemd
36. Build a System Image Containing Root Filesystem
1. Have a raw image
2. Format the raw image with designed partitions layout
3. Mount the root partition to the QEMU VM by the architecture
4. Install system packages, applications into the root partition.
Also, known as bootstrap.
5. Prepare config files for the init process into the root partition
6. Prepare /etc/fstab for mount points
7. Prepare config files for other processes into the root partition: Network,
DHCP, DNS …
8. Unmount the root partition
Note: Step 5 ~ 7 depend on the hardware and case by case.
37. Build System Images with GitHub Actions
Build kernel:
https://github.com/starnight/build-kernel/blob/main/.github/workflows/main.yml
Build system image with Alpine container images:
https://github.com/starnight/build-image/blob/main/.github/workflows/image.yml
1. Build root filesystem within the architecture’s container environment, for
example aarch64
2. Create a RAW image and partitions
3. Mount the partitions and deploy the root filesystem into the partitions
39. Boot with the Built Image on Raspberry Pi
Welcome to Alpine Linux 3.18
Kernel 6.4.2 on an aarch64 (/dev/ttyS1)
alpine-arm64 login: root
Welcome to Alpine!
…
alpine-arm64:~# dmesg
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[ 0.000000] Linux version 6.4.2 (runner@fv-az470-332) (aarch64-linux-gnu-gcc (Ubuntu
11.3.0-1ubuntu1~22.04.1) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP
PREEMPT Sat Jul 8 04:19:40 UTC 2023
[ 0.000000] random: crng init done
[ 0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.1
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000037400000, size
64 MiB
…
40. Please Refer for More Detail
● Debug Linux Kernel on Raspberry Pi:
Let's trace Linux Kernel with KGDB
● Build Root Filesystem for Raspberry Pi:
Launch the First Process in Linux System
41. Build Linux Kernel with RISC-V 64 Bits Arch
The cross compilation toolchain’s prefix is “riscv64-linux-gnu-”. Use
riscv64-linux-gnu-gcc as the compiler.
1. Get Linux kernel
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
2. Build
$ cd linux
$ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- defconfig
$ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- menuconfig
$ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
42. Boot the kernel with Root Filesystem on QEMU VM
Install packages: qemu-system-riscv and qemu-system-riscv-firmware
The root filesystem can be downloaded from starnight/build-image’s Releases.
$ qemu-system-riscv64
-M virt -smp 4 -m 2G -display none -serial stdio
-kernel ~/linux/arch/riscv/boot/Image
-append "console=ttyS0 root=/dev/vda2 rw rootfstype=ext4"
-drive file=/tmp/simple-alpine-qemu_riscv64.img,format=raw,id=hd0
-device virtio-blk-device,drive=hd0
-netdev user,id=usernet -device virtio-net-device,netdev=usernet
43. Tune the Build Config to Debug RISC-V QEMU VM
● The option CONFIG_SOC_VIRT is for QEMU virtual machine.
● For debug
○ CONFIG_DEBUG_INFO=y
○ # CONFIG_DEBUG_INFO_REDUCED is not set
○ CONFIG_GDB_SCRIPTS=y
○ CONFIG_FRAME_POINTER=y
44. Boot with the Built Image on QEMU VM (RISC-V 64)
Welcome to Alpine Linux 3.18
Kernel 6.4.2 on an riscv64 (/dev/ttyS0)
alpine-arm64 login: root
Welcome to Alpine!
…
alpine-arm64:~# dmesg
[ 0.000000] Linux version 6.4.2 (zack@starnight) (riscv64-linux-gnu-gcc (GCC)
12.2.0, GNU ld (GNU Binutils) 2.39) #3 SMP Sun Jul 9 11:30:02 CST 2023
[ 0.000000] random: crng init done
[ 0.000000] Machine model: riscv-virtio,qemu
[ 0.000000] efi: UEFI not found.
[ 0.000000] OF: reserved mem: 0x0000000080000000..0x000000008003ffff
(256 KiB) map non-reusable mmode_resv0@80000000
…
45. Boot the RISC-V 64 System for Online Debug
Append -S and -s to QEMU command:
$ qemu-system-riscv64 -h
...
-S freeze CPU at startup (use 'c' to start execution)
…
-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting
the guest without waiting for gdb to connect; use -S too
if you want it to not start execution.)
-s shorthand for -gdb tcp::1234
46. 1. Boot the QEMU virtual machine with debug feature
$ qemu-system-riscv64
-M virt -smp 4 -m 2G -display none -serial stdio
-kernel ~/linux/arch/riscv/boot/Image
-append "console=ttyS0 root=/dev/vda2 rw rootfstype=ext4"
-drive file=/tmp/simple-alpine-qemu_riscv64.img,format=raw,id=hd0
-device virtio-blk-device,drive=hd0
-netdev user,id=usernet -device virtio-net-device,netdev=usernet
-s -S
Note: It freezes CPU at startup
47. 2. Install riscv64-linux-gnu-gdb as the debugger
3. Start RISC-V 64’s GDB in the linux project folder, then debug:
$ cd ~/linux-stable && riscv64-linux-gnu-gdb vmlinux
...
Reading symbols from vmlinux...
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0x0000000000001000 in ?? ()
(gdb) break virtnet_probe
Breakpoint 1 at 0xffffffff806b87dc: file drivers/net/virtio_net.c, line 3879.
(gdb) continue
Continuing.
[Switching to Thread 1.2]
Thread 2 hit Breakpoint 1, virtnet_probe (vdev=0xff60000001e6b040) at drivers/net/virtio_net.c:3879
3879 {
(gdb)
48. Reference
● QEMU ARM guest support
● First Kernel Patch
● Linux Documentation/admin-guide/init.rst
● fdisk, mkfs.vfat, mkfs.ext4 and mount
● Alpine
● The Linux Bootdisk HOWTO - 4. Building a root filesystem
● Bootstrapping Alpine Linux
● RISC-V Specifications
49.
50. APPENDIX - AVR’s Development Environment
AVR series MCUs are used widely on Arduino classic boards. Therefore, install
the “avr-” toolchain packages:
● avr-gcc
● avr-gdb
● avr-libc
And, the flash tool: avrdude
Prepared some examples in AVR practice repository.
https://github.com/starnight/AVR-practice