Questions tagged [xtensa]

Xtensa is a customizable 32-bit RISC ISA found in Tensilica's Xtensa chips, mostly used as DSPs. (Now owned by Cadence). Use [esp32] or [esp8266] for questions about their SDKs.

Filter by
Sorted by
Tagged with
0 votes
0 answers
58 views

xtensa-esp32-elf-ld error when linking file with linker script

I'm trying to understand how an esp32 works in low level by writing a simple blinking program in c and by compiling and linking it with xtensa tools. But when I get to the linking step i get a linking ...
1 vote
1 answer
59 views

Assigning `array[i]` to variable inside loop on `i` , what pros and cons it gives in C?

There is some abstract loop that loops through array, and processes every single element without dependency of it's place in array. Element value is checked against conditions many times. Adding int ...
  • 3,746
0 votes
0 answers
84 views

Python won't recognize .mpy files

I followed a guide online to compile C code to .mpy files for micropython on the esp32. I did this by creating a dockerfile to create my work environment: FROM ubuntu:23.04 RUN apt-get update ...
  • 528
0 votes
0 answers
154 views

Printf output on godbolt using xtensa compiler?

Is there some way to produce output in godbolt for the Xtensa compiler? This #include <cstdio> int main() { printf("Hello World!"); } generates an asm call to printf, but nothing ...
  • 2,901
0 votes
1 answer
165 views

How to interpret this Xtensa exception info?

I am debugging on a Xtensa board. But I don't have enough knowledge or reference materials to interpret below exception info. Could anyone familiar with Xtensa arch shed some light? Or point me to the ...
  • 60.5k
0 votes
1 answer
111 views

Xtensa Xplorer - Failed to Install Configuration Build

am trying to run for the first time a "Hello world" program on Xtensa Xplorer , but when am trying to install configuration build , it gives me this error saying "Non-interactive mode&...
0 votes
1 answer
130 views

Why I have issue using arduino portable version with esp32 boards only?

I am trying portable arduino ide, following this tutorial : https://docs.arduino.cc/software/ide-v1/tutorials/PortableIDE if I compile empty sketch for arduino AVR boards, it works, but if I do that ...
0 votes
2 answers
154 views

Move the PC into another register with xtensa (lx6) cores

I'm trying to get the current PC value into an assembly routine written for xtensa (lx6) cores. After digging into the instruction set doc, I cannot see really how to achieve this. It looks as if the ...
1 vote
1 answer
196 views

Curly brackets in xtensa dissasembly

I'm dissassembling and inspecting (mostly for fun and learning) the Arduino code generated for an ESP8266 (Xtensa ISA). I've been following the code so far without issues until the curly brackets (...
  • 926
0 votes
0 answers
53 views

Does xteansa-xcc compiler support "-fstack-usage" and "-fdump-rtl-dfinish" compiler/linker flags?

i ran into the following errors while trying to compile my project with cmake xt-xcc ERROR parsing -fstack-usage: unknown flag xt-xcc ERROR parsing -fdump-rtl-dfinish: unknown flag
2 votes
0 answers
770 views

Xtensa xt-xcc license issue

I am trying to use Xtensa cross compiler to build a simple embedded application. And I got 2 mysterious issues. The first issue is probably a license issue: The Xtensa toolchain always reports below ...
  • 60.5k
0 votes
1 answer
94 views

How to left shift by an amount in a register with Xtensa LX7

What is the correct way to do the following in Xtensa assembly: a4 = ( 1 << a5 ) where a4 and a5 are registers and a5 could contain the value 0 to 3 (could be 0 to 7 in the future, but not too ...
  • 1,622
2 votes
0 answers
139 views

Structure bitfields compilation problem in C

Used architecture: Xtensa-LX6 I have a following definition: volatile typedef struct{ union{ struct{ uint32_t FIELD1:16; uint32_t FIELD2:12; uint32_t ...
0 votes
0 answers
41 views

nm results with trailing numbers in symbol names

I have an empty program: int main(int argc, char **argv) { return 0; } When I run nm path/to/exe --format=sysv I get numbers in the symbol names e.g file_mtx_85 and free_fn_89. With different ...
1 vote
2 answers
516 views

"Error: attempt to move .org backwards" using Xtensa XCC, GCC works fine

Here is a minimal reproducible example: /* * Example for Xtensa xt-xcc compiler "error: attempt to move .org backwards". */ struct k_dict { char *m_name_dict; char *p_name_dict; ...
  • 8,005
0 votes
0 answers
138 views

Using TFLite model on Xtensa for acceleration of ML algorithms

I was working on CNN acceleration on XTensa by using TFLite models.I used the convolution model of TFlite and imported it into xtensa for building and running the model. However, while building i ...
1 vote
0 answers
133 views

Payload from command line not overwriting the stack

I'm sorry that this is unusually long, I just want the contributors to see what I have tried before posting. My code: #include<stdio.h> #include<string.h> #include&...
  • 33
1 vote
1 answer
1k views

Assembler messages: Error: attempt to move .org backwards

I am using xtensa-esp32-elf-8.2.0 toolchain for compilation (which is based on gcc 8). I also tried with xtensa-esp32-elf-5.2.0 toolchain (which is based on gcc 5). Both generate the same error ...
0 votes
1 answer
243 views

Assembler messages -> Error : register number out of range

I am trying to use the instruction mula.dd.ll.ldinc m3 , a5 , m0 ,m1 in my assembly code on ESP32 which has xtensa LX6 processors. It doesn't produce error for other instructions, but for this ...
0 votes
1 answer
91 views

How can I find out the time required to perform of a particular instruction for Xtensa microprocessor for e.g. wsr / rsr?

I am trying to optimize a code on esp32 which uses xtensa LX6 microprocessors , I wanted to know the cost of wsr and rsr instructions which are used to read or wirte in the special registers .
0 votes
1 answer
227 views

gcc: xtensa LX106 (ESP8266) missing symbol names from ELF executable

I have a issue with gcc (5.2.0) for Xtensa LX106 CPU (ESP8266) that appears to omit some symbol names from executable (ELF) while they exists in *.map file and I am trying to understand why. This is ...
  • 1,416
0 votes
1 answer
237 views

How to map reset vector in xtensa architecture?

I am new to xtensa architecture and as the first step tried to map the reset vector. Google search took me to Uboot port of xtensa (https://github.com/jcmvbkbc/u-boot-tensa/blob/master/arch/xtensa/cpu/...
1 vote
1 answer
74 views

Writing callback function for Xtensa simcall function

I'm writing a code in C++ for Xtensa virtual platform. I want to use the functionality of the simcall_callback, to return data from the internal FW code. My C++ is a little bit rusty. How do I build ...
  • 13
1 vote
1 answer
1k views

How configure xtensa-lx106-elf to compile c++ code for esp8266 using nonos-sdk?

I'm having difficulties to compile c++ code with xtensa-lx106-elf. The manufacture of the chip I'm using (esp8266) provides a sdk (nonos-sdk). One of the libraries in this sdk implements functions ...
  • 133
0 votes
1 answer
233 views

Why am I getting "debug domain is off" error message when using Xtensa Tensilica OCD?

I'm trying to start Tensilica's Xtensa OCD Daemon by typing xt-ocd.exe in the appropriate directory but I keep getting a warning stating that "Debug domain is OFF (PWRSTAT:0x0)!" followed by an error ...
2 votes
0 answers
120 views

Adding new instructions to the processor lx106

In the xtensa documentation there is a paragraph saying that it is possible to 'burn' new instructions in the processor itself using a sort of C language. How to create new instruction in an assembly ...
0 votes
1 answer
3k views

Lubuntu. /bin/sh: 2: xtensa-lx106-elf-gcc: not found

I'm am a very beginner at this area and I have a problem compiling an example from ESP8266_NONOS_SDK-master. I've been following steps described in ESP8266 SDK Getting Started Guide form the ...
  • 137
1 vote
0 answers
876 views

ESP8266 32-bit aligned memcpy

The ESP8266 is running an xtensa core and to read data from flash storage all accesses must be performed with 32bit words. To perform this I wrote the following method: void memcpy_P(void * dst, ...
  • 10.6k
3 votes
2 answers
1k views

Xtensa --- dangerous relocation: windowed long call crosses 1GB boundary

I got the following error during compilation (.sram.text+0x1283): dangerous relocation: windowed longcall crosses 1GB boundary; return may fail: (UND+0xdeadcafe) in one of the functions. The ...
8 votes
1 answer
2k views

for loop being ignored (optimized?) out

I am using for/while loops for implementing a delay in my code. The duration of the delay is unimportant here though it is sufficiently large to be noticeable. Here is the code snippet. uint32_t i; /...
2 votes
2 answers
3k views

Xtensa instruction: L32R - which addres is loaded?

I am trying to read some xtensa assembly code and am stumped by the L32R instruction: E.g. given the following line: 0000 2f04 <my_func>: 2f0c: ffef21 l32r a2, 2ec8 Which ...
  • 7,290
14 votes
2 answers
9k views

What does a dangerous relocation error mean?

I am getting a linking error: dangerous relocation: l32r: Literal placed after use: I am still trying to debug; however, I want to better understand this error. I understand what relocation is; ...
  • 1,528