Lup Yuen Lee 李立源 Profile picture
Apr 7, 2021 21 tweets 20 min read Read on X
Now we port the #LoRaWAN Driver ... From Apache #Mynewt OS to #RISCV #BL602

github.com/lupyuen/bl_iot… Image
Our #BL602 #LoRaWAN Driver has many Layers (like Shrek) ... Let's peel the Shrek ... (erm) Layers 🧅

github.com/lupyuen/bl_iot… Image
The Application Layer (left) of our #BL602 #LoRaWAN Driver exposes LoRaWAN Functions to Application Firmware ... Join Network, Open/Close Port, Transmit/Receive Packets

github.com/lupyuen/bl_iot… BL602 LoRaWAN Driver: Appli...
#Mynewt OS has a #LoRaWAN Command-Line App that calls the Application Layer of the LoRaWAN Driver ... We shall port this app to #BL602 too

mynewt.apache.org/latest/tutoria… Image
For #Arduino Fans: @RAKwireless has a #WisBlock #LoRaWAN Tutorial ... We shall try this later

github.com/RAKWireless/Wi… Image
The Node Layer (centre) in our #BL602 #LoRaWAN Driver handles the networking operations for our BL602 LoRaWAN Node ... It's called by the Application Layer (left)

github.com/lupyuen/bl_iot… Image
What's MCPS in the #BL602 #LoRaWAN Driver? ... That's the "MAC Common Part Sublayer", which is defined in the Semtech LoRaWAN Stack

stackforce.github.io/LoRaMac-doc/Lo… Image
Semtech #LoRaWAN Stack is structured according to IEEE 802.15.4 ... Yep LoRaWAN shares the same legacy as Thread, Zigbee and 6LoWPAN! We shall port this #IoT Legacy to #BL602

en.wikipedia.org/wiki/IEEE_802.… Image
The Medium Access Control Layer (right) of our #BL602 #LoRaWAN Driver implements the LoRaWAN Protocol: Encryption, Receive Window, Duty Cycle, ... It exposes the MCPS Messaging Interface (IEEE 802.15.4) to the Node Layer (centre) via an Event Queue

github.com/lupyuen/bl_iot… Image
The #LoRaWAN Protocol is explained in this thread: Encryption, Receive Window, Duty Cycle, ...

How shall we implement the #BL602 #LoRaWAN Event Queue for the Medium Access Control Layer? With the NimBLE Porting Layer of course!

lupyuen.github.io/articles/lora2… Image
Curiously, our #BL602 #LoRaWAN Driver includes a Command-Line Interface (bottom) that Transmits and Receives LoRa Packets ... Directly calling the SX1276 Driver 🤔

github.com/lupyuen/bl_iot… Image
Uh-oh our #BL602 #LoRaWAN Driver (from Mynewt) passes LoRaWAN Packets in Mbuf Format ... Let's find something equivalent on BL602 🤔

github.com/lupyuen/bl_iot… Image
What's an Mbuf? Why is it used by our #BL602 #LoRaWAN Driver? Mbufs are Chains of Fixed-Size Blocks ... Works great with little RAM (no fragmentation) ... Created for BSD Unix in 1983!

mynewt.apache.org/latest/os/core… Image
#BL602 IoT SDK has a "pbuf" in the lwIP Lightweight TCP/IP Stack ... Maybe our BL602 #LoRaWAN Driver can use this instead of Mbuf? 🤔

github.com/lupyuen/bl_iot… Image
Here's a friendly doc by STMicro that explains MCPS Messaging in our #BL602 #LoRaWAN Driver

st.com/content/ccc/re… Image
...Which explains why so many folks at STMicro are now reading this #BL602 #LoRaWAN Thread

😉 Image
Yep "pbuf" from the #BL602 Lightweight IP Stack can be used instead of Mbuf ... We just need to shift the Header / Payload Pointer to work on #LoRaWAN Packets

github.com/lupyuen/bl_iot… Image
We verify that #BL602 "pbuf" Packet Buffers can handle a full #LoRaWAN Packet ... Header: 20 bytes, Max Payload: 255 bytes

github.com/lupyuen/bl_iot… Image
Why #BL602 "pbuf" is OK for handling #LoRaWAN Packets

github.com/lupyuen/bl_iot… Image
Our #LoRaWAN Driver uses Mbuf Queues (from Mynewt OS) ... We shall convert them to #BL602 pbuf Event Queues ... From the NimBLE Porting Library

github.com/lupyuen/bl_iot… Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Lup Yuen Lee 李立源

Lup Yuen Lee 李立源 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @MisterTechBlog

Jun 24
Our #RustLang App compiles for Software Floating-Point, but Apache #NuttX RTOS expects Hardware Floating-Point ... Let's fix this with a Rust Custom Target for QEMU #RISCV

Source: lupyuen.codeberg.page/articles/rust4…
Image
GCC Linker won’t link the binaries: Hard-Float vs Soft-Float ... Here's how we fix the #RustLang binaries in Apache #NuttX RTOS

Article: lupyuen.codeberg.page/articles/rust4…
Image
#RustLang won’t do Double-Float for 32-bit #RISCV ... Let's create a Custom Rust Target for #NuttX on QEMU

Article: lupyuen.codeberg.page/articles/rust4…
Image
Read 6 tweets
Dec 18, 2023
Let's look inside the #RISCV Sv39 Memory Management Unit ... With Apache #NuttX RTOS on @ThePine64 #Ox64 64-bit SBC

Article: lupyuen.codeberg.page/articles/mmu
Image
Protecting the RAM and I/O Memory inside our #Ox64 BL808 SBC

Article: lupyuen.codeberg.page/articles/mmu.h…
Image
Here's the Level 1 Page Table for #RISCV Sv39 Memory Management Unit

Article: lupyuen.codeberg.page/articles/mmu.h…
Image
Read 10 tweets
Sep 10, 2023
Let's power up the Display Controller inside #RISCV Star64 #JH7110 SBC @ThePine64 ... By running simple commands in the #UBoot Bootloader

Article: lupyuen.codeberg.page/articles/displ…
Image
#UBoot Commands "md" and "mw" for Dumping and Writing Memory

Article: lupyuen.codeberg.page/articles/displ…
Image
Writing to the Star64 #JH7110 UART Registers ... With #UBoot Bootloader

Article: lupyuen.codeberg.page/articles/displ…
Image
Read 14 tweets
Aug 22, 2023
#RISCV Star64 #JH7110 SBC is now supported by Apache #NuttX RTOS! Let's review how we created the first release of NuttX for Star64 @ThePine64

Article: lupyuen.codeberg.page/articles/relea…
Image
Here's how we build Apache #NuttX RTOS for #RISCV Star64 #JH7110 SBC

Article: lupyuen.codeberg.page/articles/relea…
Image
Bootable microSD with Apache #NuttX RTOS inside ... By creating a Flat Image Tree

Article: lupyuen.codeberg.page/articles/relea…
Image
Read 14 tweets
Aug 9, 2023
Apache #NuttX RTOS crashes on @ThePine64 Star64 #JH7110 #RISCV SBC because there's no Semihosting ... Let's modify NuttX to boot with an Initial RAM Disk instead (initrd)

Article: https://t.co/nhtphJNCvVlupyuen.codeberg.page/articles/semih…
Image
Apache #NuttX RTOS crashes on Star64 #JH7110 with #RISCV MCAUSE 3 ... Let's find out why

Article: https://t.co/YWcdZqVdcelupyuen.codeberg.page/articles/semih…
Image
Apache #NuttX RTOS halts with #RISCV MCAUSE 3 because of the EBREAK Instruction for Debugging ... But we're not doing any debugging!

Article: https://t.co/BZU2aQ8tjylupyuen.codeberg.page/articles/semih…
Image
Read 6 tweets
May 30, 2023
Will #LVGL Graphical Apps run in the Web Browser ... With #WebAssembly and #ZigLang Compiler? Let's find out!

Article: lupyuen.codeberg.page/articles/lvgl3… Image
#ZigLang and JavaScript will happily interoperate in #WebAssembly ... Both ways!

Article: lupyuen.codeberg.page/articles/lvgl3… Image
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(