mcu | MCU code for the BitBox01 hardware wallet | Cryptography library
kandi X-RAY | mcu Summary
kandi X-RAY | mcu Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mcu
mcu Key Features
mcu Examples and Code Snippets
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
git clone https://github.com/digitalbitbox/mcu && cd mcu
make test # or `make firmware` or `make bootloader`
make run-test
Community Discussions
Trending Discussions on mcu
QUESTION
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:08I 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.
QUESTION
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:32Here:
QUESTION
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:
- Receive data (or multiple receives),
- Transmit data (or multiple transmits),
- First transmit (or multiple transmits) and then receive data (or multiple receives)
But I have not managed to:
- 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:17According 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.
QUESTION
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:26Since 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:
QUESTION
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:17I fixed this by adding
display.setPanelsWidth(2);
display.setMuxPattern(SHIFTREG_ABC_BIN_DE);
because my led is combined by 2 matrix 32x16.
QUESTION
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:30You 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])
QUESTION
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:38Well 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:
QUESTION
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:42Only thing I can think of while seeing this code is that the value of power is huge:
QUESTION
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:
- 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:
Where would be the proper location to allocate the
BaseMember
pointer? in the constructors of the various derived classes?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 theBaseMember
pointer point to it? How can I force it not to compile in such a case?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...)?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:24EDIT Following the suggestions of the OP, I replaced the example with a fully runnable one
I would make the interface difficult to be misused:
QUESTION
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:22CN4 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
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mcu
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page