mcu | MCU code for the BitBox01 hardware wallet | Cryptography library

 by   digitalbitbox C Version: v7.1.0 License: Non-SPDX

kandi X-RAY | mcu Summary

kandi X-RAY | mcu Summary

mcu is a C library typically used in Security, Cryptography, Ethereum, Bitcoin applications. mcu has no bugs, it has no vulnerabilities and it has low support. However mcu has a Non-SPDX License. You can download it from GitHub.

The Bitbox01 is a hardware wallet that simplifies secure handling of crypto coins through storing private keys and signing transactions. The content of this repository is the bootloader and firmware used on the device. The BitBox01 is meant to be used primarily with the BitBox App, although third party integration is possible through the BitBox01 API.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mcu has a low active ecosystem.
              It has 63 star(s) with 50 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 24 have been closed. On average issues are closed in 37 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mcu is v7.1.0

            kandi-Quality Quality

              mcu has no bugs reported.

            kandi-Security Security

              mcu has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              mcu has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              mcu releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mcu
            Get all kandi verified functions for this library.

            mcu Key Features

            No Key Features are available at this moment for mcu.

            mcu Examples and Code Snippets

            Contributing
            Cdot img1Lines of Code : 5dot img1License : Non-SPDX (NOASSERTION)
            copy iconCopy
            astyle --style=kr --indent-switches --indent-labels --pad-oper --pad-header --align-pointer=name --add-braces --convert-tabs --max-code-length=90 --break-after-logical --suffix=none *.c *.h --recursive --exclude=src/yajl --exclude=src/secp256k1 --exc  
            Building the code
            Cdot img2Lines of Code : 3dot img2License : Non-SPDX (NOASSERTION)
            copy iconCopy
            git clone https://github.com/digitalbitbox/mcu && cd mcu
            make test  #  or `make firmware` or `make bootloader`
            make run-test
              

            Community Discussions

            QUESTION

            Problem with FULLY_CONNECTED op in TF Lite
            Asked 2021-Jun-15 at 13:22

            I'd like to run a simple neural network model which uses Keras on a Rasperry microcontroller. I get a problem when I use a layer. The code is defined like this:

            ...

            ANSWER

            Answered 2021-May-25 at 01:08

            I had the same problem, man. I want to transplant tflite to the development board of CEVA. There is no problem in compiling. In the process of running, there is also an error in AddBuiltin(full_connect). At present, the only possible situation I guess is that some devices can not support tflite.

            Source https://stackoverflow.com/questions/67677228

            QUESTION

            STM32 call to memcpy causes hardfault (the call to memcpy itself, not the execution of memcpy)
            Asked 2021-Jun-14 at 10:32

            Situation: I am working with a crypto library called embedded disco, I have a demo working on my PC but when porting it over to the MCU I get a hard fault when executing a library procedure. In the faulting code, the library is trying to simply copy the content of one strobe_s struct into another strobe_s. This is done twice: once for s1 and once for s2. For s1, the library simply assigns the dest. struct to the source struct. For s2 however, such an assign gave a hard fault. As the Cortex-M ISA requires aligned memory accesses, I reckoned that replacing the assignment with a memcpy should fix the problem. Nevertheless, simply stepping into memcpy using the debugger results in a hard fault! I.e. I have a breakpoint at the line with the memcpy and when stepping inside the fault handler is called! I have used memcpy to fix misaligned memory accesses in other parts of the code just fine...

            MCU: STM32L552ZET6QU

            Faulting code:

            The code below is my modification of the original library code where the assignment to *s2 was replaced by a memcpy. The original code from the library's github was:

            ...

            ANSWER

            Answered 2021-Jun-14 at 10:32

            QUESTION

            Windows Api, COM port: transmit data after receiving
            Asked 2021-Jun-14 at 07:22

            I have a microcontroller which I communicate with my windows pc, through FT232RL. On the computer side, I am making a C-library to send and receive data, using windows API.

            I have managed to:

            1. Receive data (or multiple receives),
            2. Transmit data (or multiple transmits),
            3. First transmit (or multiple transmits) and then receive data (or multiple receives)

            But I have not managed to:

            1. Transmit Data and then receive.

            If I receive anything, and then try to transmit, I get error. So, I guess when I receive data, there is a change in configuration of the HANDLE hComm, which I cannot find.

            So the question is, what changes to my HANDLE hComm configuration when I receive data, which does not allow me to transmit after that?

            Here is my code/functions and the main() that give me the error. If I run this, I get this "error 6" -screenshot of the error down below-:

            ...

            ANSWER

            Answered 2021-Jun-14 at 01:17

            According to MSDN:Sample, Maybe you need to set a pin's signal state to indicate the data has been sent/received in your microcontroller program. More details reside in your serial communication transmission of data standard. And you should write code according to the result of WaitCommEvent(hCom, &dwEvtMask, &o); like the linked sample.

            Source https://stackoverflow.com/questions/67903175

            QUESTION

            STM32 SPI communication with HAL
            Asked 2021-Jun-11 at 11:58

            I just started programming a STM32 and generated a code with CubeMX for an SPI communcation with a gyroscope (L3GD20) I have a problem with the HAL_SPI commands.

            I first try to read the WHO_AM_I register which return a good response (0xD4) Then I tried to do the same with CTRL_REG1 register and it was still good by returning (0x07).

            But if I try to get both of them one after the other, the HAL_SPI_Receive keeps sending the data of the first HAL_SPI_Transmit of the code... Tried to give it other buffers but still didn't work.

            Here is the part of the code I'm intersted in :

            ...

            ANSWER

            Answered 2021-Jun-11 at 10:26

            Since HAL_SPI_Receive is already using HAL_SPI_TransmitReceive (github stm32f4 spi driver) to send dummy data to generate clock, you can use that fact and ditch the HAL_SPI_Transmit, and use the receive function like this:

            Source https://stackoverflow.com/questions/67922914

            QUESTION

            P10 Led Matrix 64x32 not show true in pixeltime (PxMatrix library) with ESP8266 NodeMCU
            Asked 2021-Jun-10 at 09:17

            I am learning how to control P10 Led matrix 64x32 with NodeModule MCU ESP8266, I google and found this library https://github.com/2dom/PxMatrix and this tutorial https://www.instructables.com/RGB-LED-Matrix-With-an-ESP8266/. I believed that I wire between P10 and ESP8266 in true way in the tutorial, but that P10 led does not display as the example:

            The true result will be:

            This is my wire diagram:

            This is my code:

            ...

            ANSWER

            Answered 2021-Jun-10 at 09:17

            I fixed this by adding

            display.setPanelsWidth(2);

            display.setMuxPattern(SHIFTREG_ABC_BIN_DE);

            because my led is combined by 2 matrix 32x16.

            Source https://stackoverflow.com/questions/67522932

            QUESTION

            Adding a RAM section in linker file STM32
            Asked 2021-Jun-06 at 16:30

            I am trying very hard to understand how to use a linker file, but my brain is apparently not getting it at all. I am using an STM32L476, which has two RAM regions, RAM and RAM2 (memory definition below). I would like to put a buffer into RAM2, but there is no section for RAM2 in the default linker script that is generated by Cube. Seems like a good exercise for me. I really thought that the following would do the trick, where all I've added is the .sensor_buffer section:

            ...

            ANSWER

            Answered 2021-Jun-06 at 16:30

            You have an error somewhere else. Maybe you simply do not use this linker script (you forgot to add or change the name in the command line)

            I have compiled it and linked it without any problems with CubeIDE (I use 100 and 100 in the buffer declarations as I do not know the values of your macros [100x100 = 0x2710])

            Source https://stackoverflow.com/questions/67860784

            QUESTION

            Undefined behavior when using interrupts with ATmega48PA
            Asked 2021-Jun-06 at 06:38

            I am building a simple Timer/Counter application, that generates a delay using the normal mode in Atmel's ATmega48PA, using Timer1, toggling an LED in a constant time interval. What happens is when using the interrupt, the LED toggles for a definite amount of time, then the toggling effect halts, keeping the LED always ON! I believe there is something with the sei() function or enabling the global interrupt in SREG, as I had experienced such behavior with the same microcontroller before when using interrupts.

            Here is a code snippet provided with my question, although anybody will see this code as very normal and have to be working correctly!

            ...

            ANSWER

            Answered 2021-Jun-06 at 06:38

            Well at the first look, there is no special problem in your code. So let's check the possibilities:

            First you have done some 32-bit long calculations and put the result in the 16-bit register:

            TCNT1 = ( ( 4194304 - delayMS ) * 1000 ) / 64; it results in an unpredictable value that has been entered in the register. so I recommend you to use appropriate values or using (long) and (int) to your code to prevent data overflow.

            Second You have not entered the correct data line order:

            Source https://stackoverflow.com/questions/67851746

            QUESTION

            Hard fault on sprintf() with float after toolchain update
            Asked 2021-May-31 at 16:15

            I have an opensource project (https://github.com/WhiteFossa/yiff-l), where I use STM32F103 MCU.

            In firmware I have a lot of sprintf's with float parameters, for example:

            ...

            ANSWER

            Answered 2021-May-31 at 13:42

            Only thing I can think of while seeing this code is that the value of power is huge:

            Source https://stackoverflow.com/questions/67774729

            QUESTION

            best practice for getting polymoprhic behavior for one data member of an abstract base class
            Asked 2021-May-31 at 09:24

            I would like to know what would be a good approach, from a software design standpoint, to a situation where each derived class should have a different type of polymorphic data member. In more detail:

            I'm writing a library that has an abstract base class Base that users of the library will inherit from. for one member of Base, let's call it BaseMember, I want polymorphic behavior. What I mean by that is that various classes derived from Base will "contain" different subclasses of BaseMember - some will contain a OneDerivedMember, others will contain AnotherDerivedMember etc (all of these are derived from BaseMember, and all are supplied in the library). The reason for wanting that, is that I want to be able to go over some collection of Base pointers and activate some functionality of BaseMember (which is implemented differently for its different derived classes). As I understand it, I am guessing I have to make BaseMember a pointer. Now my questions start:

            1. First of all, is all of this even a good approach or do you sense a "code smell" here? Is building it like that a common practice?

            Assuming the basic approach is OK:

            1. Where would be the proper location to allocate the BaseMember pointer? in the constructors of the various derived classes?

            2. Can I enforce that the derived classes actually do this allocation? i.e. what if a user didn't understand, or forget, that they needed to allocate one kind or other of SomeDerivedMember and make the BaseMember pointer point to it? How can I force it not to compile in such a case?

            3. Where should this member be released (de-allocated)? I suppose the RAII approach dictates it would be in the same scope it was allocated in (so, destructor of derived class?) but this forces every user of the library to remember to do this de-allocation. Instead, I could do it in the destructor of Base (i.e. in the library, not by the user) - but would this violate the RAII principle? and what if the user DID decide to de-allocate it (double delete...)?

            4. Alternatively to all this, can you imagine a way to have equivalent polymorphic behavior without even using dynamic allocation? This code is for a low-level embedded MCU, Cortex M4 or similar cores and bare metal (no OS) - so I try to stay away from dynamic allocation wherever possible.

            I feel this kind of situation must be be fairly common, and there would be a design pattern that solves this cleanly, however I'm not sure what that would be.

            Example code:

            ...

            ANSWER

            Answered 2021-May-31 at 09:24

            EDIT Following the suggestions of the OP, I replaced the example with a fully runnable one

            I would make the interface difficult to be misused:

            Source https://stackoverflow.com/questions/67716196

            QUESTION

            Cannot connect to target : STlink V3 not connecting to Nucleo Board using SWD
            Asked 2021-May-28 at 13:28

            I am using STLink V3 set to program the F103RB Nucleo board using SWDIO interface. The board works fine when connected to PC using the on-board STlink debugger but when I use external STlink device to program it, it says "Can not connect to target!". I have removed on-board STlink debugger jumpers so that I can use external one. My connection from Stlink V3 to F103RB Nucleo (CN4 Header) are as follows:
            Clock->Clock, GND->GND, SWDIO->SWDIO, NRST->NRST,VCC->NOT CONNECTED (Even if I connect, it doesn't work)

            The datasheet says that "SB12 NRST (target MCU RESET) must be OFF if CN4 pin 5 is used in the external application", is this the problem ? How to resolve that ? or is there any other potential reason for this error.

            I'll really appreciate prompt responses. Thanks

            ...

            ANSWER

            Answered 2021-May-28 at 08:22

            CN4 connector is connected to on-board ST-LINK, which is used when you use on-board ST-LINK to program/debug an external device.

            You need to access pins of the main uC using other connectors.

            Please see this answer: https://electronics.stackexchange.com/questions/566511/how-can-i-program-a-stm32-nucleo-board-without-using-the-on-board-st-link/566515#566515

            Source https://stackoverflow.com/questions/67734462

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mcu

            You can download it from GitHub.

            Support

            Please use the coding style set by AStyle version 3.0 (http://astyle.sourceforge.net/; also available from homebrew) with the following parameters:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Cryptography Libraries

            dogecoin

            by dogecoin

            tink

            by google

            crypto-js

            by brix

            Ciphey

            by Ciphey

            libsodium

            by jedisct1

            Try Top Libraries by digitalbitbox

            bitbox-wallet-app

            by digitalbitboxGo

            bitbox02-firmware

            by digitalbitboxC

            bitbox-base

            by digitalbitboxGo

            2FA-app

            by digitalbitboxJavaScript

            bitbox02-backup-recovery

            by digitalbitboxJavaScript