54

That's what the programmer does. It takes the binary output from the compiler and stores it in the MCU's Flash EPROM, usually over a serial bus. Flash EPROM requires a programming algorithm to store data in it, with any erases first. The programmer carries out this algorithm. It's not like writing data to RAM. This is very well documented and explained on ...


32

A programmer is the implementation of " via specific bus,". Some devices have inbuilt bootloaders (may be hardware or software or firmware) that allow the use of a port of some sort to load code. Whenever a feature is included in a device that is not utilised during normal operation it adds an unproductive overhead. On very large and capable ...


21

transfer it to specific place in flash memory via specific bus This is exactly what flash programmer devices do. They just don't use some slow archaic crap like RS232, but instead nowadays usually JTAG/SWD. Often translated to/from USB. A high speed bus like JTAG is required to enable two things: Somewhat accurate real-time debugging, including things like ...


11

The __weak keyword means that the function can be overridden by creating another function with the same declaration. Many of the interrupt-functions etc. in the STM HAL libraries are declared as weak so that you can override them with your own function, instead of modifying the library functions. From GCC Manual: weak The weak attribute causes the ...


8

The ability to self-program has a number of costs, and generally these costs can be avoided by leaving that ability out: The self-programming MCU can brick itself. Oops... Security: may add a path for a hacker to be able to modify the device's firmware remotely. You have to have an external programming interface to get the initial program in, anyway (...


8

As explained in this stackexchange question a function defined as "_weak" can be overwritten by a user-defined function with the same name. It basically is a default function. If you don't write your own, the compiler will use the weak one. If you do define your own function with the same name, the compiler will ignore the weak one.


7

The other answers were generally good, but didn't necessarilly spell everything out clearly IMHO. To load a compiled program into a microcontroller, the PC that holds the compiled program needs to be connected directly to the microcontroller in some way that provides a method of bidirectional communication. That's one of the jobs of a programing device: to ...


5

It has nothing to do with STM32 or embedded programming. It's just a compiler dependent extension to tell the C compiler that an object is weakly declared, as by default objects are strongly declared. The example posted is just a way for the HAL to provide a default implementation of a function if the user does not write a function with the same name to ...


4

My advice would be to connect one of the ICs to both SD cards and use it as an interface. The other IC can request a write / read from the first one. If the two SD cards are on different boards, connect each one to its IC and then communicate between the ICs through SPI, I2C etc. It was not quite clear what is on which board from your post. Multiplexing it ...


3

The term bootloader is generic - it can mean many things depending on the exact context. There's a bit of history that might make things a little clearer: Early computers had no means of storing startup code, so you would have to enter a small piece of code via switches or other means to bootstrap the computer. This small piece of code might load another ...


2

Depends on the processor, in the 8088 the processor loads one instruction from 0x7c00 on the I/O and the first 64kB of memory. The chips used to be separate IC's now the ram rom and processor can all be manufactured on the same IC. So on a microcontroller the first thing the state machine of the processor does is reset and then start loading instructions ...


2

A microcontroller's boot loader does a subset of the things a BIOS does. At minimum, it prepares the machine for loading the main operating system, even if that ‘operating system’ is just a simple application loop. In most systems, the bootloader does the following: sets up the hardware (DRAM controller, etc.) sets up memory (clears RAM, loads interrupt ...


2

I don’t know anything about OneWire, but the & operator in C is used to access the address of the referenced variable. So for example if you have a variable unsigned short PORTE, then &PORTE is a pointer to PORTE. So for this driver you have, you need to pass the address of PORTE to the function Ow_Reset for it to work properly. That is why the & ...


1

The significant area comes from the page tables : this is an array of addresses, i.e. a significant chunk of memory, forming a lookup table where the HW (the MMU) looks up the physical address mapped to a virtual address (and complains if the virtual address is unmapped). These page tables are the bulk of the MMU area. The complaint is known as a "page ...


1

The hardware to translate virtual addresses to physical addresses typically requires a significant chip area to implement, and not all chips used in embedded systems include that hardware, which is another reason some of those systems don't use virtual memory. This is called an "MMU". To be clear, it's not separate, if present it will be part of ...


1

Since matlab/simulink generated code is being used, performance doesn't seem to be an issue. If a development kit is the basis for the development, with access to IO pins, a SPI SRAM may be an option: Just an example. Chose one with compatible specs (voltage etc).


1

The camera and radar are ASIL-B level devices. In a Level 2 ADAS, if they fail, they fail passively such that the driver is warned to take over. Being ECU inputs (and not logic 1/0 type) detecting stuck-at for radar and camera on the ECU interface side doesn’t make sense. Loss of signal is enough. Do these sensors need internal diags to detect stuck-at? I ...


1

Let's be honest, a handle usually is a pointer. It's probably a pointer to some data struct. Though as some commenters have said, it doesn't have to be. It could be an integer cast to a "void *", just to mislead you. The thinking behind a "handle" is that it's opaque. Even if it really is a pointer, it's been cast to "void *", ...


1

Not all microcontrollers need to be programmed via protocols and connections designated for a debug probe or programmer device. As an example, the STM32F446RE microcontroller has two boot pins that control if the microcontroller executes the program stored in its (main) flash memory, if it boots from its SRAM, or it it boots the program from its so-called &...


Only top voted, non community-wiki answers of a minimum length are eligible