In i2c.s, I found some macros, but anyone wont use label.macro I2C_delay
wait 10 // 38 // minimal 4.7us
.endm
.macro read_SCL // Return current level of SCL line, 0 or 1
READ_RTC_REG(RTC_GPIO_IN_REG, RTC_GPIO_IN_NEXT_S + 9, 1) // RTC_GPIO_9 == GPIO_32
.endm
.macro read_SDA // Return current level of SDA line, 0 or 1
READ_RTC_REG(RTC_GPIO_IN_REG, RTC_GPIO_IN_NEXT_S + 8, 1) // RTC_GPIO_8 == GPIO_33
.endm
.macro set_SCL // Do not drive SCL (set pin high-impedance)
WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TC_REG, RTC_GPIO_ENABLE_W1TC_S + 9, 1, 1)
.endm
.macro clear_SCL // Actively drive SCL signal low
// Output mode
WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TS_REG, RTC_GPIO_ENABLE_W1TS_S + 9, 1, 1)
.endm
.macro set_SDA // Do not drive SDA (set pin high-impedance)
WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TC_REG, RTC_GPIO_ENABLE_W1TC_S + 8, 1, 1)
.endm
.macro clear_SDA // Actively drive SDA signal low
// Output mode
WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TS_REG, RTC_GPIO_ENABLE_W1TS_S + 8, 1, 1)
.endm
ULP global variables
Re: ULP global variables
Re: ULP global variables
Yes, that is an issue (bug) with the ULP assembler, labels like 1b and 1f do not work.I'm trying to create local numeric variables (to be able to use in macros), but all the methods I've tried from various sites do not compile!
I have already tried declaring local labels for macros:
\1:
&1:
$ 1:
LOCAL 1:
etc. With this, I would use jump 1b to go to label "1" before the jump.
None worked. How can I define these "dynamic labels" for use in macros? I need to call the macro several times.
If I use symbolic labels (like: "abc:"), assembler says: "label already defined".
Reference with dynamic labels:
https://sourceware.org/binutils/docs-2. ... mbol-Names
I plan to look at it in the assembler sources, because GAS should be able to handle these labels.
Note that it is in general better to use real functions instead of macros, because macros generate a lot of code (when you call them several times) and code size is limited for the ULP.
Re: ULP global variables
Work around:Yes, that is an issue (bug) with the ULP assembler, labels like 1b and 1f do not work.
I plan to look at it in the assembler sources, because GAS should be able to handle these labels.
Note that it is in general better to use real functions instead of macros, because macros generate a lot of code (when you call them several times) and code size is limited for the ULP.
Code: Select all
nop
.set target,1f
jump target
nop
1:
nop
Re: ULP global variables
Why assembly of ulp is "raw"?
Whats the version/name of this assembly? I would like to study it, but not find any name/version, most similar (I think) is GNU assembly, but various mnemonics not exist or not work...
Whats the version/name of this assembly? I would like to study it, but not find any name/version, most similar (I think) is GNU assembly, but various mnemonics not exist or not work...
Re: ULP global variables
https://github.com/espressif/binutils-esp32ulpWhy assembly of ulp is "raw"?
Whats the version/name of this assembly? I would like to study it, but not find any name/version, most similar (I think) is GNU assembly, but various mnemonics not exist or not work...
Re: ULP global variables
This should fix it:Yes, that is an issue (bug) with the ULP assembler, labels like 1b and 1f do not work.
I plan to look at it in the assembler sources, because GAS should be able to handle these labels.
https://github.com/espressif/binutils-esp32ulp/pull/5
Re: ULP global variables
This question is kind of strange, but how can I add this edited file to binutils? For the installation, I used the files "ready": (https://github.com/espressif/binutils-e ... #downloads), and installed directly in the folder. But now that you have edited a different file, I have tried to follow the binutils README.This should fix it:Yes, that is an issue (bug) with the ULP assembler, labels like 1b and 1f do not work.
I plan to look at it in the assembler sources, because GAS should be able to handle these labels.
https://github.com/espressif/binutils-esp32ulp/pull/5
I tried to do this:
1-) I downloaded the binutils.
2-) I edited the old file for your new one.
2-) I opened the mingw32 and went to the binutils folder.
3-) Commands used: make, make install.
4-) I tested the label:
.macro delay
stage_rst
1: stage_inc 1
wait 64000
jumps 1b, 125, lt
.endm
and continued presenting the error. I'm pretty sure that the installation was incorrect, unless the update does not work.
Can you take a step-by-step or indicate some better way to do this update?
Re: ULP global variables
See viewtopic.php?f=2&t=3228This question is kind of strange, but how can I add this edited file to binutils? For the installation, I used the files "ready": (https://github.com/espressif/binutils-e ... #downloads), and installed directly in the folder. But now that you have edited a different file, I have tried to follow the binutils README.
I tried to do this:
1-) I downloaded the binutils.
2-) I edited the old file for your new one.
2-) I opened the mingw32 and went to the binutils folder.
3-) Commands used: make, make install.
4-) I tested the label:
.macro delay
stage_rst
1: stage_inc 1
wait 64000
jumps 1b, 125, lt
.endm
and continued presenting the error. I'm pretty sure that the installation was incorrect, unless the update does not work.
Can you take a step-by-step or indicate some better way to do this update?
You must specify an target when building or you will get an x86 toolchain. Probably you will find new toolchain binairies in your installation directory without the esp32 prefix.
Note that using jumps within macros did not work for me (unrelated to bf local labels). No errors but non working code. Not sure why....
Re: ULP global variables
Ok, I tried your post from link, and ming show some problems, however, i tried to make flash and got error, obvious.See viewtopic.php?f=2&t=3228This question is kind of strange, but how can I add this edited file to binutils? For the installation, I used the files "ready": (https://github.com/espressif/binutils-e ... #downloads), and installed directly in the folder. But now that you have edited a different file, I have tried to follow the binutils README.
I tried to do this:
1-) I downloaded the binutils.
2-) I edited the old file for your new one.
2-) I opened the mingw32 and went to the binutils folder.
3-) Commands used: make, make install.
4-) I tested the label:
.macro delay
stage_rst
1: stage_inc 1
wait 64000
jumps 1b, 125, lt
.endm
and continued presenting the error. I'm pretty sure that the installation was incorrect, unless the update does not work.
Can you take a step-by-step or indicate some better way to do this update?
You must specify an target when building or you will get an x86 toolchain. Probably you will find new toolchain binairies in your installation directory without the esp32 prefix.
Note that using jumps within macros did not work for me (unrelated to bf local labels). No errors but non working code. Not sure why....
Image list of errors:
https://imgur.com/a/TBCqm
Re: ULP global variables
@tomtor
Just errors. What can I do???
MAKE error: https://i.imgur.com/Ha1jH4V.jpg

MAKE INSTALL error: https://i.imgur.com/zttSpvM.jpg

Just errors. What can I do???
MAKE error: https://i.imgur.com/Ha1jH4V.jpg

MAKE INSTALL error: https://i.imgur.com/zttSpvM.jpg

Who is online
Users browsing this forum: Amazon [Bot], ChatGPT-User and 10 guests