问题标签 [bare-metal]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1479 浏览

optimization - llvm optimizes with library functions

Starting with code like this

using llvm as a cross compiler

and it detects and replaces it with a real memset when the optimizer is used

but implements it without.

I don't want that I want it to compile the code I gave it for the target I gave it rather than use library calls. I thought the -disable-simplify-libcalls would do it but it doesn't.

I thought I had figured this out before, but cant find out how to do it. I need the optimizer, I don't want this circular dependency problem of implementing the library and it needing the library, etc. Could do it in asm to take the compiler out of the loop, but shouldn't have to.

0 投票
3 回答
757 浏览

embedded-linux - Baremetal benchs & software

I'm looking on some information about bare-metal programming. I'm working on different powerpc platforms, and currently trying to prove that some tests are not impacted by the linux kernel. These tests are pretty basic, loads and stores in asm volatile, some benchmarks as well (Coremark, Dhrystone, etc). These tests run perfectly on Linux, but i now have to test them in baremetal, an environement i don't really have experience in. All my platforms have u-boot installed, and i'm wondering if there is such applications that would allow me to run my tests powerpc-eabi cross-compiled ? for example, would a gdbserver launched by u-boot be able to communicate via serial port, or ethernet ? Is it possible to have a busybox called by U-boot ?

0 投票
3 回答
2259 浏览

c - 链接器脚本:将特定文件放在后面的位置

我想编写一个看起来像这样的链接器脚本:

我的意图是按以下顺序:

  • 带有.textfrom的部分startup.o
  • .text,.data.bss包含来自所有其他输入文件的那些部分,除了other.o
  • ,.text.data部分.bss来自other.o

当然,我给出的脚本存在问题:other.o包含在*之前使用的通配符中,因此它没有放在输出部分other中。

除了手动列出所有输入目标文件栏other.o代替*s 之外,还有什么方法可以在这里实现我想要的吗?

0 投票
1 回答
7268 浏览

embedded - 如何在 C 或内联汇编中设置 ARM 中断向量表分支?

有人可以向我展示如何在没有 RTOS 或 Linux OS 的裸机环境中使用 C 或内联汇编设置 ARM9 中断向量表的示例吗?

具体来说,如何使用内联汇编或 C 将分支设置为用 C 编码的 IRQ 中断处理程序 ISR?

中断入口表

提前感谢任何提示或方向。

ARM9 的裸机开发示例很难找到。

埃德

  • 德州仪器 TMS320DM6466
  • Code Composer Studio v5.5
0 投票
0 回答
587 浏览

console - 如何注册我的 UART putc 或 puts 函数以与标准库 printf() 函数一起使用?

我正在为我的 beaglebone 编写一个裸机程序。所以我使用 UART0 作为我的串行调试消息。我做了一个自定义函数,叫做

这会将字符或字符串输出到我可以在终端窗口中看到的 uart0。

来自导师图形的 Sourcery-Codebench 是我在这里使用的编译器套件,它提供带有 printf() 的标准 C 库。现在我想要连接我的 uart0_putc 和 uart0_puts,这样我就可以使用提供的 printf() 在我的终端上获取格式化的消息。

谁能告诉我这可行吗?以及如何做同样的事情?

提前致谢。

0 投票
0 回答
660 浏览

assembly - Uboot 终止独立应用程序

我在终止一个通过 uboot 运行的独立应用程序时遇到了一点问题。我正在开发基于 TI 的基于 omap5 的评估板。Uboot 工作正常,我有一个简单的程序,我可以使用 loady 通过 uboot 的命令提示符上传并使用 go 执行它[加载地址]。

问题是程序运行并显示一串字符后,它就挂在那里了。我必须手动重置板子才能启动它并继续使用 uboot。我正在使用的启动汇编代码是这个

基本上我只想在我的程序执行后返回命令提示符

编辑:

我正在运行的代码

0 投票
1 回答
1811 浏览

arm - LLVM(arm-none-eabi 目标)正在为基于 C 的代码生成 ARM.exidx 部分(?)

使用 Clang/LLVM(arm-none-eabi 目标)编译简单的 HelloWorld.c 会产生重定位部分“.rel.ARM.exidx”,但使用 arm-gcc 不会。这些 LLVM 生成的展开表条目被正确标记为 canunwind。但是,为什么它们根本不需要它们,因为它们是不需要的,并且当您获得 AXF 中每个 C 函数的条目时只会导致膨胀?

在测试 Clang 默认值时:如果我将“-funwind-tables”传递给 Clang 以强制展开 C 函数,如果我编写 .cpp 函数并且“-fno-unwind-tables”结果相同,我会得到我所期望的结果如上。

1) 仅使用 C 函数时,无论如何都要关闭 .ARM.exidx 部分,因为它们总是被标记为“cantunwind”。

2)无论如何在链接期间剥离这一部分?(gc 部分当然不起作用,因为这些表条目引用了正在使用的函数)

3) 为什么 arm-gcc 不创建此部分(嗯,如果您使用新的 lib、nano 等...但我使用和链接没有 std 库)

0 投票
0 回答
364 浏览

c - Error-aware bootloader for Raspberry Pi

I want to write a simple bootloader for the Raspberry Pi. The main purpose of this bootloader is to enable a Raspberry Pi at a remote location, to recover from kernel updates that make the device unbootable as the result of a kernel panic. The procedure for updating the kernel should be like this:

The default Linux kernel is /boot/rpi-kernel.img and the string 'rpi-kernel.img' is written in /boot/default-kernel.txt. The kernel parameter 'panic=10' has been added to 'cmdline=' in /boot/config.txt.

  1. Connect to the Raspberry Pi over SSH.
  2. Copy /boot/rpi-kernel.img to /boot/rpi-kernel-fallback.img
  3. Create empty file /boot/kernel_update
  4. Download kernel update and move it to /boot/rpi-kernel.img
  5. Reboot

This is the design for the bootloader I have thought up in pseudocode:

As a last step in the boot process, a shell script will check if the /boot/kernel_update exists and then if network is functional and the environment is sane, before removing /boot/kernel_update.

I want to make the bootloader as clean and simple as possible, with no support for HDMI, USB, Ethernet, serial etc. The problem is that I'm not sure how to get started with this.

The main challenges are to read from and write to the FAT32 filesystem on the SD card, and booting the Linux kernel. Everything has to happen from bare metal on the Raspberry Pi.

Any code examples, resources, suggestions ect. on doing this would be very helpful.

0 投票
3 回答
5032 浏览

qt - Qt 裸机是什么?

QtCreator 有一个名为“Bare Metal”的插件。裸机是指没有操作系统的计算机。我对 Qt Bare Metal 开发的了解不多。这是为裸机系统开发 Qt 的一种方式吗?Qt 可以在没有操作系统的系统上运行吗?如果是,这种方法对嵌入式系统开发有什么好处?

0 投票
1 回答
39 浏览

parallel-processing - 制作应用程序的副本

我正在研究多核处理器。

我想制作一个 AMP 系统,即——我有一个应用程序在 core0 上成功运行,我希望完全相同的应用程序也运行 core1。但是这两个应用程序不会相互交互——就像两个不同的应用程序在不同的内核上运行一样。

我该怎么做?可能的计划是: 1. 将已编译的应用程序复制到 RAM 的不同位置,并将新位置的起始地址提供给 core1 以从那里开始执行。使用链接描述文件。

你们有人试过吗?如果您已经尝试过,那么您能否给我一个示例代码,说明如何为其编写链接器脚本 - 因为我是编译和生成 ELF 文件的新手。我用谷歌搜索了很多天,我只得到了算法,但没有可以从中学习的代码。

谢谢,

P:S - 没有操作系统实现为它唯一需要一直执行的一个线程。并且所有核心都将独立执行它们自己的线程实例。简而言之——所有核心都将执行相同的应用程序,但独立于它的不同实例。