{"id":19701890,"url":"https://github.com/microchiptech/same51_ble_can_sniffer","last_synced_at":"2026-06-14T05:33:14.325Z","repository":{"id":252722553,"uuid":"840864403","full_name":"MicrochipTech/SAME51_BLE_CAN_Sniffer","owner":"MicrochipTech","description":"\"IoT Made Easy!\" - RNBD451 BLE Peripheral Example: CAN Bus Sniffer","archived":false,"fork":false,"pushed_at":"2024-08-21T00:04:32.000Z","size":31854,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T05:03:26.002Z","etag":null,"topics":["ble","can","rnbd451","same51","sniffer"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicrochipTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T23:31:44.000Z","updated_at":"2025-05-17T06:14:14.000Z","dependencies_parsed_at":"2024-08-12T04:28:50.868Z","dependency_job_id":"1c2af0b6-8b69-491c-b380-14f26f93aa77","html_url":"https://github.com/MicrochipTech/SAME51_BLE_CAN_Sniffer","commit_stats":null,"previous_names":["microchiptech/same51_ble_can_sniffer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MicrochipTech/SAME51_BLE_CAN_Sniffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2FSAME51_BLE_CAN_Sniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2FSAME51_BLE_CAN_Sniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2FSAME51_BLE_CAN_Sniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2FSAME51_BLE_CAN_Sniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicrochipTech","download_url":"https://codeload.github.com/MicrochipTech/SAME51_BLE_CAN_Sniffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrochipTech%2FSAME51_BLE_CAN_Sniffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34310801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ble","can","rnbd451","same51","sniffer"],"created_at":"2024-11-11T21:11:26.741Z","updated_at":"2026-06-14T05:33:14.309Z","avatar_url":"https://github.com/MicrochipTech.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ATSAME51 BLE Peripheral Example : CAN Bus Sniffer\n\n\u003cimg src=\"media/IoT-Made-Easy-Logo.png\" width=100\u003e\n\n\u003e \"IoT Made Easy!\" \n\nDevices: **| ATSAME51 | RNBD451 |**\u003cbr\u003e\nFeatures: **| CAN | BLE |**\n\n\n## ⚠ Disclaimer\n\n\u003cp\u003e\u003cspan style=\"color:red\"\u003e\u003cb\u003e\nTHE SOFTWARE ARE PROVIDED \"AS IS\" AND GIVE A PATH FOR SELF-SUPPORT AND SELF-MAINTENANCE. This repository contains example code intended to help accelerate client product development. \u003c/br\u003e\n\nFor additional Microchip repos, see: \u003ca href=\"https://github.com/Microchip-MPLAB-Harmony\" target=\"_blank\"\u003ehttps://github.com/Microchip-MPLAB-Harmony\u003c/a\u003e\n\nCheckout the \u003ca href=\"https://microchipsupport.force.com/s/\" target=\"_blank\"\u003eTechnical support portal\u003c/a\u003e to access our knowledge base, community forums or submit support ticket requests.\n\u003c/span\u003e\u003c/p\u003e\u003c/b\u003e\n\n## Introduction\n\nThis document describes how to program a Microchip 32-bit Cortex-M4F MCU to connect to a Smartphone via BLE while monitoring messages received over its connected CAN bus. A sample smartphone app is provided to communicate with the MCU via BLE and display the CAN FD messages received by the MCU. A Host PC running a terminal emulator serves as a debug window to send/receive diagnostic messages to/from the Host MCU.\n\n\u003cimg src=\".//media/SAME51_BLE_CAN_BlockDiagram.png\" width=700/\u003e\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Hardware Requirements](#hardware-requirements)\n- [Demo Platform Assembly](#demo-platform-assembly)\n- [Software Requirements](#software-requirements)\n- [Program Demo Firmware](#program-demo-firmware)\n- [Testing Procedure](#testing-procedure)\n- [Custom GATT Services](#custom-gatt-services)\n\n## Hardware Requirements\n\n* Base Adapter Board: [\"Curiosity Nano Base for Click Boards\"](https://www.microchip.com/en-us/development-tool/ac164162)\n\n    \u003cimg src=\".//media/curiosity-nano-adapter.jpg\" width=375/\u003e\n\n* Host MCU Add-On Board: [\"SAM E51 Curiosity Nano Evaluation Kit\"](https://www.microchip.com/en-us/development-tool/ev76s68a)\n\n    \u003cimg src=\".//media/sam-e51-curiosity-nano.jpg\" width=375/\u003e\n\n* BLE Module: [\"RNBD451 Add-on Board\"](https://www.microchip.com/en-us/development-tool/ev25f14a) board featuring Microchip's [RNBD451PE](https://www.microchip.com/en-us/product/RNBD451PE) certified BLE module\n\n    \u003cimg src=\".//media/rnbd451-add-on-board.jpg\" width=250/\u003e\n\n* High Speed CAN FD Transceiver: [\"ATA6563 Click\"](https://www.mikroe.com/ata6563-click) featuring Microchip's [ATA6563](https://www.microchip.com/en-us/product/ata6563)\n\n    \u003cimg src=\".//media/ata6563-click.jpg\" width=250/\u003e\n\n* USB-to-CAN Adapter for Host PC: [\"PCAN-USB FD Adapter\"](https://phytools.com/collections/peak-system-technik/products/pcan-usb-fd-adapter) manufactured by [phytools](https://phytools.com) (or equivalent diagnostic tool that can generate CAN messages)\n\n    \u003cimg src=\".//media/PCAN-USB-FD_Adapter.png\" width=300/\u003e\n\n    \u003cimg src=\".//media/phytools_logo.png\" width=300/\u003e\n\n## Demo Platform Assembly\n\n1. Set the jumper on the RNBD451 Add-On Board so that the two pins furthest away from the module are shorted.\n\n    \u003cimg src=\".//media/HW_Setup_01.png\" width=500/\u003e\n\n2. Install the RNBD451 Add-On Board onto mikroBUS socket #2 of the Curiosity Nano Base.\n\n    \u003cimg src=\".//media/HW_Setup_02.png\" width=500/\u003e\n\n3. Connect the supplied 28-pin headers underneath the SAM E51 Curiosity Nano (soldering is optional) and then install the SAM E51 Curiosity Nano onto the 56-pin socket of the Curiosity Nano Base.\n\n    \u003cimg src=\".//media/HW_Setup_03.png\" width=500/\u003e\n\n4. Connect the PC to the SAM E51 Curiosity Nano using a micro-USB cable and note the new Virtual COM port number that is associated with your connection (e.g. use the Windows Device Manager and look for `USB Serial Device`).\n\n    \u003cimg src=\".//media/HW_Setup_04.png\" width=500/\u003e\n    \u003cimg src=\".//media/Win10_DeviceManager.png\" width=400/\u003e\n\n5. Install the ATA6563 Click board onto mikroBUS socket #1 of the Curiosity Nano Base.\n\n    \u003cimg src=\".//media/HW_Setup_05.png\" width=500/\u003e\n\n6. Using a DB-9 female-to-female serial cable, connect the PCAN-USB FD Adapter to the ATA6563 Click board, then connect the adapter's USB cable to an available USB port of the Host PC.\n\n    \u003cimg src=\".//media/HW_Setup_06.png\" width=500/\u003e\n\n7. Confirm that all boards and connections have been made for the complete hardware platform.\n\n    \u003cimg src=\".//media/HW_Setup_07.png\" width=600/\u003e\n\n## Software Requirements\n\nEmbedded software development tools need to be installed in order to properly program (and interact with) the WBZ451 Curiosity Development Board.\n\n1. Microchip `MPLAB X` tool chain for embedded code development on 32-bit architecture MCU/MPU platforms (made up of 3 major components)\n\n    - [MPLAB X IDE](https://www.microchip.com/mplab/mplab-x-ide) (when prompted, enable the installation of the [MPLAB IPE](https://www.microchip.com/en-us/tools-resources/production/mplab-integrated-programming-environment) too)\n        \n        NOTE: This demonstration project was last tested successfully with MPLAB X **v6.20**. If a previous version of the IDE is needed, download it from the [MPLAB Development Ecosystem Downloads Archive](https://www.microchip.com/en-us/tools-resources/archives/mplab-ecosystem) (to fall back to the version Microchip successfully tested prior to release). \n\n    - [MPLAB XC32 Compiler](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-xc-compilers#tabs)\n\n        NOTE: This demonstration project was tested successfully with XC32 **v4.45**, and in general should work with later versions of the compiler as they become available. If you encounter issues building the project with a newer version of the compiler, it is recommended to download the compiler version that was last tested successfully from the [MPLAB Development Ecosystem Downloads Archive](https://www.microchip.com/en-us/tools-resources/archives/mplab-ecosystem) (to fall back to the version Microchip successfully tested prior to release). \n\n     - [MPLAB Harmony Software Framework](https://microchipdeveloper.com/harmony3:mhc-overview)\n\n2. [Git](https://git-scm.com) (a free and open source distributed version control system)\n\n    - Download/install the latest version of [Git for Windows, macOS, or Linux](https://git-scm.com/downloads)\n\n    - Verify working operation of the `Git Bash` prompt (e.g. for Windows: click `Start` \u003e type `Git Bash`)\n\n3. Any [Terminal Emulator](https://en.wikipedia.org/wiki/List_of_terminal_emulators) program of your choice\n\n4. [Microchip Bluetooth Data](https://play.google.com/store/apps/details?id=com.microchip.bluetooth.data\u0026hl=en_US\u0026pli=1) smartphone app\n\n5. PCAN-USB FD Adapter [Device Driver for Windows](https://www.peak-system.com/quick/DrvSetup) \n\n## Program Demo Firmware\n\n1. Clone/download the MPLAB X demo project by issuing the following command line in a `Command Prompt` or `PowerShell` window.\n\n    ```bash\n    git clone https://github.com/MicrochipTech/SAME51_BLE_CAN_Sniffer.git\n    ```\n\n2. Launch the MPLAB X IDE.\n\n3. Open the demo project:\n\n    - From the MPLAB X mail toolbar, select `File \u003e Open Project`\n    - Navigate to the `SAME51_BLE_CAN_Sniffer\\firmware` folder\n    - Select (click on) the `sam_e51_cnano_rnbd451.X` project folder\n    - Click on the `Open Project` button\n\n4. Clean and build the project:\n\n    - Click on the `Clean and Build Main Project` icon in the MPLAB X main toolbar\n\n        \u003cimg src=\".//media/mplab_clean_build.png\" width=450/\u003e\n\n5. Program the ATSAME51 Host MCU:\n\n    - Click on the Make and Program Device Main Project icon in the MPLAB X main toolbar \n        \u003cimg src=\".//media/mplab_make_program.png\" width=375/\u003e\n\n    - Verify that the programming phase was successful\n        \u003cimg src=\".//media/mplab_prog_success.png\" width=600/\u003e\n\n6. Connect a smartphone to the RNBD451 BLE module using the Microchip Bluetooth Data (MBD) app:\n\n    - Follow the procedure outlined in [Section 7.2.2.1](https://onlinedocs.microchip.com/oxy/GUID-26457D23-798C-47B0-9F40-C5DA6E995C6F-en-US-2/GUID-4D5EDD33-45BA-469D-BB9F-DE40465F8E82.html) (\"Text Mode\") of the [RNBD451 Bluetooth Low Energy User's Guide](https://onlinedocs.microchip.com/oxy/GUID-26457D23-798C-47B0-9F40-C5DA6E995C6F-en-US-2/index.html)\n\n## Testing Procedure\n\n1. Open a serial terminal window (e.g. TeraTerm) and connect to the COM port corresponding to your board (e.g. choose `File` \u0026gt; choose `New connection`\u0026gt; choose `Serial`\u0026gt; select `USB Serial Device`).\n\n    \u003cimg src=\".//media/TeraTerm_NewConnection.png\" width=400/\u003e\n\n2. Set the baud rate for the COM port connection at `115200 baud` (e.g. choose `Setup` \u0026gt; choose `Serial port`\u0026gt; type in `115200` for the speed \u0026gt; click `New setting`).\n\n    \u003cimg src=\".//media/TeraTerm_SerialPort.png\" width=400/\u003e\n\n3. It is recommended to enable the \"Local Echo\" feature in the terminal settings in order to see every key that's typed into the terminal window.\n\n4. Change the toggle rate of `LED0` on the SAM E51 Curiosity Nano board:\n    - Press the **SW0** button on the SAM E51 Curiosity Nano and note the LED toggle rate change on every press\n    - View the toggle rate confirmation messages in the Microchip Bluetooth Data (MBD) smartphone app\n\n5. Send text messages from the Host PC to the smartphone:\n\n    - Type characters in the terminal window and confirm reception/display in the MBD app\n        \u003cimg src=\".//media/terminal_to_mbd.png\" width=600/\u003e\n    - Type characters in the MBD app and confirm reception/display in the terminal window\n        \u003cimg src=\".//media/mbd_to_terminal.png\" width=600/\u003e\n\n6. Launch the PCAN-View PC application.\n\n7. In the `CAN Setup` tab, select `SAE J2284-4 (500k/2M)` for the Bit Rate Preset:\n    \u003cimg src=\".//media/PCAN-View_CAN_Setup.png\" width=400/\u003e\n\n8. In the serial terminal window, type `M` or `m` to bring up the list of available CAN operations. Enter the keys `1`, `2`, `3`, `4`, \u0026 `5` to send out sample standard and extended CAN messages.\n    \u003cimg src=\".//media/CAN_demo_menu.png\" width=600/\u003e\n\n9. In the PCAN-View GUI, confirm that 5 different CAN messages show up in the `Receive` window.\n    \u003cimg src=\".//media/PCAN-View_Receive.png\" width=600/\u003e\n\n10. Create/transmit a new **standard** CAN message by selecting `File \u003e New Message` in the PCAN-View's main toolbar. In the **New Transmit Message** pop-up window:\n\n    - Enter an ID that's less than 0x7FF\n    - Select the number of data bytes in the message and set the value of each byte as desired \n    - Under Message Type, ensure that only the boxes checked are for `CAN FD` and `Bit Rate Switch`\n    - Enter a cycle time to send out the same message periodically (in milliseconds)\n    - Click on the OK button to start the transmission of repeating messages\n\n        \u003cimg src=\".//media/PCAN-View_StandardMesg.png\" width=400/\u003e\n\n11. Create/transmit a new **extended** CAN message by selecting `File \u003e New Message` in the PCAN-View's main toolbar. In the **New Transmit Message** pop-up window:\n\n    - Enter an ID that's greater than or equal to 0x10000\n    - Select the number of data bytes in the message and set the value of each byte as desired\n    - Under Message Type, ensure that the 3 boxes checked are `Extended Frame`, `CAN FD`, and `Bit Rate Switch`\n    - Enter a cycle time to send out the same message periodically (in milliseconds)\n    - Click on the OK button to start the transmission of repeating messages\n\n        \u003cimg src=\".//media/PCAN-View_ExtendedMesg.png\" width=400/\u003e\n\n12. In the `Transmit` window of the PCAN-View GUI, confirm that both messages are being received periodically based on the settings of each message's cycle time.\n\n    \u003cimg src=\".//media/PCAN-View_Transmit.png\" width=700/\u003e\n\n13. Confirm that the same periodic CAN message transmissions are displayed in the Microchip Bluetooth Data (MBD) smartphone app.\n\n## Custom GATT Services\n\nThe [RNBD451](https://www.microchip.com/en-us/product/rnbd451pe) BLE module allows the user to create Bluetooth SIG-defined public GATT services as well as customer private services through simple UART commands. The specifications published by the Bluetooth SIG defines the public GATT services while the user defines their own private GATT services.\n\nFor an example of creating/programming a custom GATT service into the [RNBD451PE](https://www.microchip.com/en-us/product/rnbd451pe) BLE module, follow the procedure outlined in [Section 7.3](https://onlinedocs.microchip.com/oxy/GUID-26457D23-798C-47B0-9F40-C5DA6E995C6F-en-US-2/GUID-983D3FDA-5470-49F5-B8AC-E142DB5C1461.html\n) (“Creating and Accessing GATT Services using UART Commands”) of the [RNBD451 Bluetooth Low Energy User's Guide](https://onlinedocs.microchip.com/oxy/GUID-26457D23-798C-47B0-9F40-C5DA6E995C6F-en-US-2/index.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrochiptech%2Fsame51_ble_can_sniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrochiptech%2Fsame51_ble_can_sniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrochiptech%2Fsame51_ble_can_sniffer/lists"}