<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://paulomarruda.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://paulomarruda.github.io/" rel="alternate" type="text/html" /><updated>2025-02-25T14:23:07+00:00</updated><id>https://paulomarruda.github.io/feed.xml</id><title type="html">Paulo Arruda</title><subtitle></subtitle><entry><title type="html">Bluepill</title><link href="https://paulomarruda.github.io/2024/05/19/bluepill.html" rel="alternate" type="text/html" title="Bluepill" /><published>2024-05-19T00:00:00+00:00</published><updated>2024-05-19T00:00:00+00:00</updated><id>https://paulomarruda.github.io/2024/05/19/bluepill</id><content type="html" xml:base="https://paulomarruda.github.io/2024/05/19/bluepill.html"><![CDATA[<p>–
layout: post
title: Developing a HAL for the STM32 Bluepill
–</p>

<h2 id="why-zig">Why Zig</h2>

<h2 id="what-is-a-hal">What is a HAL</h2>

<h2 id="the-board">The Board</h2>

<h2 id="the-development-envioriemnt">The Development Envioriemnt</h2>

<h2 id="the-linker-script">The Linker Script</h2>

<pre><code class="language-linker">MEMORY 
{
    FLASH (rx)  : ORIGIN = 0x08000000, LENGTH = 128K
    RAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}ENTRY(main);
__reset_stack_pointer = ORIGIN(RAM) + LENGTH(RAM);SECTIONS {
    .text : {
        LONG(__reset_stack_pointer);
        LONG(main | 1);
        /* The whole interrupt table is 332 bytes long. Advance to that position. */
        . += 332;
        /* And here comes the rest of the code, ie. all symbols starting with .text */
        *(.text)
        *(.rodata*)
        . = ALIGN(4);
    } &gt; FLASH  /* Put this in the flash memory region */.ARM.exidx : {
        *(.ARM.exidx*)
        . = ALIGN(4);
    } &gt; FLASH
}
</code></pre>

<h2 id="startup-functions">Startup Functions</h2>]]></content><author><name></name></author><summary type="html"><![CDATA[– layout: post title: Developing a HAL for the STM32 Bluepill –]]></summary></entry></feed>