Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload firmware to module #21

Open
fhunleth opened this issue Aug 31, 2020 · 2 comments
Open

Upload firmware to module #21

fhunleth opened this issue Aug 31, 2020 · 2 comments

Comments

@fhunleth
Copy link
Collaborator

Currently, blue_heron relies on the Bluetooth module having working firmware on boot or on side effects from desktop Linux kernel modules loading firmware. Since the goal is to work without assistance from the Linux kernel's Bluetooth stack, it needs to be able to upload firmware too.

Bluetooth module firmware seems to universally be distributed as .hcd files. These files are effectively scripts containing HCI commands. Each HCI command should be sent to the module and blue_heron should wait for an acknowledgment. It's probably fine to have multiple commands in flight to improve performance if that is an issue. Note that the C code has a limit of 4 commands in flight at a time. That could be changed.

Some more information is at https://community.cypress.com/community/software-forums/wiced-studio-bluetooth/wiced-studio-bluetooth-forums/blog/2019/07/10/cypress-bluetooth-soc-programming.

As you can see here, https://github.com/LibreELEC/brcmfmac_sdio-firmware-rpi/tree/master/firmware/brcm, .hcd files are named based on the module. Somehow Linux figures out the name automatically. I assume that there's some HCI command or something that gives the name to use, but I don't know. I believe, but don't know for sure, that the other files from that link are completely handled by the WiFi driver and that we can ignore them for blue_heron.

@ivanhercaz
Copy link

Hi @fhuneth!

Thank you for the information provided in this issue. I am currently interested in the possibility of blue_heron in a Raspberry Pi 4 CM, that uses the Cypress CYW43455 module according to its datasheet. And according to the hardware compatibility table of blue_heron it seems this was tested but it didn't works, then I see the notice with retry message after solving this issue.

Some more information is at https://community.cypress.com/community/software-forums/wiced-studio-bluetooth/wiced-studio-bluetooth-forums/blog/2019/07/10/cypress-bluetooth-soc-programming.

Unfortunately the link isn't available yet and I tried to get an archived snapshot but there isn't anyone available (Wayback Machine is resumed 😢).

As you can see here, https://github.com/LibreELEC/brcmfmac_sdio-firmware-rpi/tree/master/firmware/brcm, .hcd files are named based on the module. Somehow Linux figures out the name automatically. I assume that there's some HCI command or something that gives the name to use, but I don't know. I believe, but don't know for sure, that the other files from that link are completely handled by the WiFi driver and that we can ignore them for blue_heron.

Excuse me if I paraphrase you, it is to know if I am understanding you correctly.

Linux figures out the required firmware to load automatically depending of the system, so I understand it does the same in the case of a Nerves system. But it seems sometimes it doesn't work in the case of a Nerves system so to not depend on Linux, this issue is to try to implement a way that could be handled by Nerves, automatically in the startup pipeline or manually using iex (e.g., something like a load_bluetooth_firmware function), that internally will need to run a command to set up it. But at this moment it is still unknown how.

I could try to research a bit more about this issue if in the current project in which I am working still want to use Nerves and/or a Raspberry Pi 4 CM after I report them the state of the art of bluetooth in Nerves.

Thanks in advance for your attention and for all your contributions to Elixir/Nerves ecosystem ❤️ .

@ivanhercaz
Copy link

Some more information is at https://community.cypress.com/community/software-forums/wiced-studio-bluetooth/wiced-studio-bluetooth-forums/blog/2019/07/10/cypress-bluetooth-soc-programming.

Unfortunately the link isn't available yet and I tried to get an archived snapshot but there isn't anyone available (Wayback Machine is resumed 😢).

I know it has been many years since this issue and since you read this link but, do you remember if the link was the same than the one I paste below? At least date matches ("Jul 10, 2019" and the last part of the URL is similar.

https://community.infineon.com/t5/Knowledge-Base-Articles/Cypress-Bluetooth-SoC-Programming-Guide/ta-p/246400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants