-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (32 loc) · 14.6 KB
/
index.html
File metadata and controls
32 lines (32 loc) · 14.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><title>AllThingsEmbedded</title>
<meta name=renderer content="webkit"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta http-equiv=Cache-Control content="no-transform"><meta http-equiv=Cache-Control content="no-siteapp"><meta name=theme-color content="#f8f5ec"><meta name=msapplication-navbutton-color content="#f8f5ec"><meta name=apple-mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="#f8f5ec"><meta name=author content="Javier Alvarez"><meta name=description content="The place for embedded software"><meta name=keywords content="Software,Embedded,Engineering"><meta name=generator content="Hugo 0.136.5 with theme even"><link rel=canonical href=https://allthingsembedded.com/staging-web/><link href=https://allthingsembedded.com/staging-web/index.xml rel=alternate type=application/rss+xml title=AllThingsEmbedded><link href=https://allthingsembedded.com/staging-web/index.xml rel=feed type=application/rss+xml title=AllThingsEmbedded><link rel=apple-touch-icon sizes=180x180 href=/staging-web/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/staging-web/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/staging-web/favicon-16x16.png><link rel=manifest href=/staging-web/manifest.json><link rel=mask-icon href=/staging-web/safari-pinned-tab.svg color=#5bbad5><link href=/staging-web/sass/main.min.1bc0b1ccabce7c341a15ac616ada786a029897bddcf8d31661ac69b2efb39993.css rel=stylesheet><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin=anonymous><meta property="og:url" content="https://allthingsembedded.com/staging-web/"><meta property="og:site_name" content="AllThingsEmbedded"><meta property="og:title" content="AllThingsEmbedded"><meta property="og:description" content="The place for embedded software"><meta property="og:locale" content="en_us"><meta property="og:type" content="website"><meta itemprop=name content="AllThingsEmbedded"><meta itemprop=description content="The place for embedded software"><meta itemprop=datePublished content="2025-02-25T21:13:08+01:00"><meta itemprop=dateModified content="2025-02-25T21:13:08+01:00"><meta name=twitter:card content="summary"><meta name=twitter:title content="AllThingsEmbedded"><meta name=twitter:description content="The place for embedded software"><!--[if lte IE 9]><script src=https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js></script><![endif]--><!--[if lt IE 9]><script src=https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js></script><script src=https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js></script><![endif]--></head><body><div id=mobile-navbar class=mobile-navbar><div class=mobile-header-logo><a href=/ class=logo id=mobile-header-logo></a></div><div class=mobile-navbar-icon><span></span>
<span></span>
<span></span></div></div><nav id=mobile-menu class="mobile-menu slideout-menu"><ul class=mobile-menu-list><a href=/staging-web/><li class=mobile-menu-item>Home</li></a><a href=/staging-web/post/><li class=mobile-menu-item>Archives</li></a><a href=/staging-web/tags/><li class=mobile-menu-item>Tags</li></a></ul></nav><script type=text/javascript src=/js/common.js></script><script type=text/javascript>colorize_base16("mobile-header-logo","AllThingsEmbedded")</script><div class=container id=mobile-panel><header id=header class=header><div class=logo-wrapper><a href=/ class=logo id=logo-wrapper></a></div><script type=text/javascript src=/js/common.js></script><script type=text/javascript>colorize_base16("logo-wrapper","AllThingsEmbedded")</script><nav class=site-navbar><ul id=menu class=menu><li class=menu-item><a class=menu-item-link href=/staging-web/>Home</a></li><li class=menu-item><a class=menu-item-link href=/staging-web/post/>Archives</a></li><li class=menu-item><a class=menu-item-link href=/staging-web/tags/>Tags</a></li></ul></nav></header><main id=main class=main><div class=content-wrapper><div id=content class=content><section id=posts class=posts><article class=post><header class=post-header><h1 class=post-title><a class=post-link href=/staging-web/post/orphan_sections_linker/>Linkers and orphaned sections</a></h1><div class=post-meta><span class=post-time>2025-02-25 </span><span class=more-meta>2044 words </span><span class=more-meta>10 mins read</span></div></header><div class=post-content><div class=post-summary><h2 id=problem-statement>Problem statement</h2><p>I recently came across a situation in a project where I had the following code:</p><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt> 1
</span><span class=lnt> 2
</span><span class=lnt> 3
</span><span class=lnt> 4
</span><span class=lnt> 5
</span><span class=lnt> 6
</span><span class=lnt> 7
</span><span class=lnt> 8
</span><span class=lnt> 9
</span><span class=lnt>10
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-cpp data-lang=cpp><span class=line><span class=cl><span class=k>struct</span> <span class=nc>FaultInfo</span> <span class=k>final</span> <span class=p>{</span>
</span></span><span class=line><span class=cl> <span class=kt>uint32_t</span> <span class=n>r0</span><span class=p>;</span>
</span></span><span class=line><span class=cl> <span class=kt>uint32_t</span> <span class=n>r1</span><span class=p>;</span>
</span></span><span class=line><span class=cl> <span class=c1>// And all the other register state of a Cortex-M0+ processor
</span></span></span><span class=line><span class=cl><span class=c1></span> <span class=c1>// ...
</span></span></span><span class=line><span class=cl><span class=c1></span>
</span></span><span class=line><span class=cl> <span class=kt>uint32_t</span> <span class=n>crc</span><span class=p>;</span>
</span></span><span class=line><span class=cl><span class=p>};</span>
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl><span class=na>[[gnu::section(".uninit")]]</span> <span class=k>volatile</span> <span class=n>FaultInfo</span> <span class=n>fault_data</span><span class=p>;</span>
</span></span></code></pre></td></tr></table></div></div><p>I was using this static region of data to persist some fault information across
reboots, to log it on the next boot after recovering from the fault.</p></div><div class=read-more><a href=/staging-web/post/orphan_sections_linker/ class=read-more-link>Read more...</a></div></div></article><article class=post><header class=post-header><h1 class=post-title><a class=post-link href=/staging-web/post/data_structure_static_pointer/>Data Structures: Ditto::static_ptr<Base, Derived, ...></a></h1><div class=post-meta><span class=post-time>2022-01-02 </span><span class=more-meta>993 words </span><span class=more-meta>5 mins read</span></div></header><div class=post-content><div class=post-summary><p>One of the nice things about <code>C++</code> compared to <code>C</code> is its ability to define reusable types and data structures. They make code reuse easier and also help with reasoning if the abstraction is high-level enough.</p><p>Today we are going to talk about <code>static_ptr</code> from the library <a href=https://github.com/javier-varez/ditto>Ditto</a>. Dynamic allocation is often forbidden when developing embedded systems. This leads to allocating most things either in the stack or globally. A <code>static_ptr</code> allows the user to statically allocate an object of a derived class and access it as a base class pointer. The nice thing is that it allows to easily implement the <code>factory pattern</code> if only one instance of each child is required at a time.</p></div><div class=read-more><a href=/staging-web/post/data_structure_static_pointer/ class=read-more-link>Read more...</a></div></div></article><article class=post><header class=post-header><h1 class=post-title><a class=post-link href=/staging-web/post/bare-metal-register-access-api/>Bare Metal C++ Register Access API</a></h1><div class=post-meta><span class=post-time>2021-09-25 </span><span class=more-meta>4260 words </span><span class=more-meta>20 mins read</span></div></header><div class=post-content><div class=post-summary><h2 id=introduction-to-memory-mapping>Introduction to memory-mapping</h2><p><strong>Note:</strong> This section is introductory material for those who are not yet familiar with the concept of memory-mapping. If you are already experienced with memory-mapping feel free to jump to the next section. Most likely you won’t miss anything new.</p><p>One of the most common ways of accessing peripherals from a CPU is <code>memory-mapping</code>. In short, this means that the address space of the CPU has some addresses that when accessed read/write peripheral’s registers. In order to access such peripherals from our code there are multiple strategies that could be used. This post will explore multiple alternatives and discuss their differences and fitness for their unique task.</p></div><div class=read-more><a href=/staging-web/post/bare-metal-register-access-api/ class=read-more-link>Read more...</a></div></div></article><article class=post><header class=post-header><h1 class=post-title><a class=post-link href=/staging-web/post/2020-04-11-mastering-the-gnu-linker-script/>Mastering the GNU linker script</a></h1><div class=post-meta><span class=post-time>2020-04-11 </span><span class=more-meta>2764 words </span><span class=more-meta>13 mins read</span></div></header><div class=post-content><div class=post-summary><p>Most people getting started with embedded development seem to find linker scripts just another piece of magic required to get up and running with their system. Even when they might already be familiar with memory-mapped peripherals and basic embedded concepts, the linker script and how it interacts with the GNU linker (ld) is still pretty mysterious.</p><p>Today we will go through the main functions of a linker script to try to shed some light onto their operation. We covered the basic of cross compilation in a previous post. We mentioned that the linker would be the last step in the compilation process. The job of the linker is to take all input object files and libraries (both shared and static) and generate a single executable file. Let’s start with some terminology.</p></div><div class=read-more><a href=/staging-web/post/2020-04-11-mastering-the-gnu-linker-script/ class=read-more-link>Read more...</a></div></div></article><article class=post><header class=post-header><h1 class=post-title><a class=post-link href=/staging-web/post/2019-10-12-bootloaders-and-arm-cortex-m-microcontrollers-booting-the-target-application/>Bootloaders and ARM Cortex-M microcontrollers: Booting the target application</a></h1><div class=post-meta><span class=post-time>2019-10-12</span><div class=post-category><a href=/staging-web/categories/bootloader/>Bootloader</a></div><span class=more-meta>1085 words </span><span class=more-meta>6 mins read</span></div></header><div class=post-content><div class=post-summary><p>In a previous <a href=/post/2019-01-03-arm-cortex-m-startup-code-for-c-and-c/>blog</a> we discussed the role of the NVIC in ARM Cortex-M microcontrollers. This peripheral will play a central role in booting our target application. First of all, we need to discuss the boot process in an ARM Cortex-M microcontroller.</p><h2 id=boot-process>Boot process</h2><ul><li>After Power On Reset the microcontroller assumes the NVIC table is located at address 0x00000000.</li><li>The processor fetches the first two words in the NVIC table, corresponding to the <strong>top of the stack</strong> and the <strong>reset vector</strong>.</li><li>It sets the MSP (Main stack pointer) to the top of the stack.</li><li>It jumps to the address indicated by the reset vector.</li><li>Application program execution begins.</li></ul><p>In the case of our bootloader, the processor will be loading the top of the stack and the reset vector of our bootloader and then start executing it. Then, we the bootloader decides if it can boot an application already present at flash memory or if it needs to load an application using the loader. No matter which is chosen, it will eventually have to boot the target application.</p></div><div class=read-more><a href=/staging-web/post/2019-10-12-bootloaders-and-arm-cortex-m-microcontrollers-booting-the-target-application/ class=read-more-link>Read more...</a></div></div></article></section><nav class=pagination><a class=next href=/staging-web/page/2/><span class=next-text>Next</span>
<i class="iconfont icon-right"></i></a></nav></div></div></main><footer id=footer class=footer><div class=social-links><a href=mailto:javier.alvarez@allthingsembedded.net class="iconfont icon-email" title=email></a><a href=https://twitter.com/Javier_varez class="iconfont icon-twitter" title=twitter></a><a href="https://www.linkedin.com/in/javieralvarez17/?locale=en_US" class="iconfont icon-linkedin" title=linkedin></a><a href=https://github.com/Javier-varez class="iconfont icon-github" title=github></a><a href=/staging-web/index.xml type=application/rss+xml class="iconfont icon-rss" title=rss></a></div><div class=copyright><span class=power-by>Powered by <a class=hexo-link href=https://gohugo.io>Hugo</a>
</span><span class=division>|</span>
<span class=theme-info>Theme -
<a class=theme-link href=https://github.com/olOwOlo/hugo-theme-even>Even</a>
</span><span class=copyright-year>©
2018 -
2025<span class=heart><i class="iconfont icon-heart"></i></span><span>Javier Alvarez</span></span></div></footer><div class=back-to-top id=back-to-top><i class="iconfont icon-up"></i></div></div><script src=https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin=anonymous></script><script src=https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin=anonymous></script><script src=https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin=anonymous></script><script type=text/javascript src=/staging-web/js/main.min.4ae89da218555efa0e7093a20b92017d2e1202b66fff9fc2edf4cb8d44b44c6e.js></script><script type=text/javascript>window.MathJax={tex:{}}</script><script async src=https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js integrity="sha256-HGLuEfFcsUJGhvB8cQ8nr0gai9EucOOaIxFw7qxmd+w=" crossorigin=anonymous></script></body></html>