-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
at32uc3a0: Initial work for SimpleMachines' Mizar32-A #11709
Conversation
@ramangopalan Please fix the following warning:
to fix the ci error:
avr32-gcc need to be installed, please reference how avr-gcc install in: |
Dear @xiaoxiang781216, Dear @acassis, Greetings! Many thanks for your suggestions. I have fixed them except the ones Is there a way I can test the Dockerfile changes for avr32-gcc in a |
You can download the image from https://github.com/apache/nuttx/pkgs/container/nuttx%2Fapache-nuttx-ci-linux, and try various docker commands.
The change looks good, please squash them. But please fix the remain warning before update the pr:
|
Dear @pkarashchenko,
The 32-bit variant is at 1 and the 64-bit at 2. I have used both |
Dear All, I just implemented this but haven't tested it yet. Do you think this
I still think I am missing an entry within linux/Dockerfile. I don't
Please note: I haven't tested it. But can someone please help test |
Dear NuttX Community, Greetings! So sorry about the delay in my response. I have squashed the review |
LGTM, let ci do the final check.
You can try the installed tool locally with the follow command:
You need split cibuild.sh/Dockerfile change into new patch. After it get merged, ci can verify the result with this patch. |
Dear @xiaoxiang781216, Dear @acassis, Greetings! I didn't have a chance to visit the NuttX code OR rebase
I have just made an initial commit with AVR32 specific changes within I could be wrong; I didn't verify these changes locally. If it goes Would this be OK? Please let me know if I got something wrong. Many |
I tried pushing another commit moments ago but this problem persists:
Can you please give me a hint on this one? I am unable to see the full |
Am I missing a similar step for AVR32 within Dockerfile? I am unable
May I ask: A similar recipe exists within ubuntu.sh. i.e. to fetch a |
Hi @ramangopalan seems like the issue is some authorization issue (or missing folder/directory)
|
@xiaoxiang781216 any idea why is it happening? |
@ramangopalan it's better to move the docker change to the new pr since ci still use the old docker image util the patch get merged. |
tools/ci/docker/linux/Dockerfile
Outdated
@@ -381,6 +381,10 @@ ENV PATH="/tools/gcc-arm-none-eabi/bin:$PATH" | |||
COPY --from=nuttx-toolchain-arm64 /tools/gcc-aarch64-none-elf/ gcc-aarch64-none-elf/ | |||
ENV PATH="/tools/gcc-aarch64-none-elf/bin:$PATH" | |||
|
|||
# AVR32 toolchain | |||
COPY --from=nuttx-toolchain-avr32 /tools/avr32-gnu-toolchain-linux_x86/ avr32-gnu-toolchain-linux_x86/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where you download the toolchain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear @xiaoxiang781216,
where you download the toolchain?
I intend to download the toolchain from [1]. In the code, where must I
add it so CI can see it? I have added some code in [2] which clones
the toolchain. Am I missing something? Here is a snip from [2]:
avr32_gcc_toolchain() {
add_path "${NUTTXTOOLS}"/avr32-gnu-toolchain-linux_x86/bin
if [ ! -f "${NUTTXTOOLS}/avr32-gnu-toolchain-linux_x86/bin/avr32-gcc" ]; then
local basefile
basefile=avr32-gnu-toolchain-linux_x86
cd "${NUTTXTOOLS}"
# Download the AVR32 GCC toolchain
git clone https://github.com/ramangopalan/${basefile}
fi
command avr32-gcc --version
}
References:
[1]: https://github.com/ramangopalan/avr32-gnu-toolchain-linux_x86
[2]: tools/ci/platforms/ubuntu.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiaoxiang781216 could you please help here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramangopalan need to add in the Dockerfile:
nuttx/tools/ci/docker/linux/Dockerfile
Line 120 in 4178f3e
###############################################################################
# Build image for tool required by AVR32 builds
###############################################################################
FROM nuttx-toolchain-base AS nuttx-toolchain-avr32
# Download the latest AVR32 GCC toolchain prebuilt by Raman
RUN mkdir -p gcc-avr32-gnu && \
git clone https://github.com/ramangopalan/avr32-gnu-toolchain-linux_x86 gcc-avr32-gnu
nuttx/tools/ci/docker/linux/Dockerfile
Line 385 in 4178f3e
# AVR32 toolchain
COPY --from=nuttx-toolchain-avr32 /tools/gcc-avr32-gnu/ gcc-avr32-gnu/
ENV PATH="/tools/gcc-avr32-gnu/bin:$PATH"
nuttx/tools/ci/docker/linux/Dockerfile
Line 440 in 4178f3e
ln -sf `which ccache` /tools/ccache/bin/avr-g++ && \ |
ln -sf `which ccache` /tools/ccache/bin/avr32-gcc && \
ln -sf `which ccache` /tools/ccache/bin/avr32-g++ && \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @simbit18 !!!
@ramangopalan could you please include these suggestion? If it fixes the issue we could integrate this PR and get AVR32 tested in our CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why clone didn't go though. Did I miss something?
Could it be about a setting on Github?
--------------------
125 | # Download the prebuilt AVR32 GCC toolchain
126 | >>> RUN mkdir -p gcc-avr32-gnu && \
127 | >>> git clone https://github.com/ramangopalan/avr32-gnu-toolchain-linux_x86 gcc-avr32-gnu
128 |
--------------------
ERROR: failed to solve: process "/bin/sh -c mkdir -p gcc-avr32-gnu && git clone https://github.com/ramangopalan/avr32-gnu-toolchain-linux_x86 gcc-avr32-gnu" did not complete successfully: exit code: 127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramangopalan in the stage is missing git try this:
###############################################################################
# Build image for tool required by AVR32 builds
###############################################################################
FROM nuttx-toolchain-base AS nuttx-toolchain-avr32
# Download the prebuilt AVR32 GCC toolchain
RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -qq \
git
# Clone Main Repository
RUN mkdir -p gcc-avr32-gnu && \
git clone --depth 1 https://github.com/ramangopalan/avr32-gnu-toolchain-linux_x86 gcc-avr32-gnu
e01e91a
to
3565dab
Compare
@simbit18 even with your suggestion still failing with same error message:
|
@acassis dockerfile does not have this
in the stage is missing git RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -qq |
@acassis @ramangopalan testing on my repository docker image build process
Dockerfile test the avr32 version in the docker image
|
thank you @simbit18, so your Dockerfile looks very similar to that here, what you did different? I compared your Dockerfile against mainline and there difference seem to exist in Raman docker as well:
|
in the docker it is necessary to add:
|
Dear @simbit18, Dear @acassis, Aren't the tests for nsh and ostest for avr32dev1 performed by
Could something be wrong here? The paths look fine to me.
I am trying to find the log entries pertaining to fetching avr32-gcc. |
Dear @simbit18,
I see apt-install git here too. Is fetching git necessary for AVR32 |
Dear @acassis, Greetings,
Sure. Understand. Also, do you think I should remove the following entries for avr32dev1?
|
@ramangopalan please rebase your patch to the last master |
5e2d7f8
to
7338752
Compare
Dear @xiaoxiang781216, Dear @acassis, Dear @simbit18,
Many thanks for your suggestions. I have removed the avr32dev1 entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear @xiaoxiang781216, Dear @acassis, Dear @simbit18,
@ramangopalan please rebase your patch to the last master
Many thanks for your suggestions. I have removed the avr32dev1 entry from other.dat. Please let me know if there's anything else I can help with. I look forward to furthering peripheral support for Mizar32. Thanks once again.
@ramangopalan leave in the file tools/ci/testlist/other.dat the entry
/avr
otherwise avr boards are not build !!!
https://github.com/apache/nuttx/actions/runs/9584486153/job/26428379693?pr=11709#step:7:73
Dear @simbit18,
So sorry. I didn't realize this. I fully understand. |
Dear @acassis, Greetings! I looked at the code to see what was
I used Mizar32A, the latest NuttX and dfu-programmer for checks. I have allocated the UART pins and clock (from the datasheet [1], pin In Mizar32's case, the regval local from up_consoleinit() is supposed Hence, it works when I enable PM_PBAMASK_USART2. I do understand Clearly, there are bit-position differences between avr32dev1 and Is there a way I can simplify this patch and fix these parts when I Jolly good weekend. References: |
Dear @acassis, I am attaching a snap of the USART clock mask bit-positions. Is using |
Dear Raman, |
Dear @acassis, Greetings! I introduced at32uc3a_pm.h and at32uc3b_pm.h. The build works fine for |
look like avr compiler doesn't support
which is added here: |
@xiaoxiang781216 At the moment I have seen that the problem only affects boards/avr/at32uc3/mizar32a/src/avr32_bringup.c 1) Simple solution to this error comment out directive '#warning' otherwise solutions are in the file tools/testbuild.sh 2) for microcontroller/System-on-Chip (at32uc3) 3) for boards (avr32dev1 and mizar32a) Opinions? |
Thank you @simbit18 for keeping eyes on it. Is there some way to avoid converting this #warning in error in our CI? |
These are the two solutions I tested on my repository to edit extra c/c++ flags "-Wno-cpp -Werror" https://github.com/simbit18/nuttx/blob/16582dbf780d2b754383b8bd6627cb373e83f8c6/tools/testbuild.sh#L549 The tests I did showed an error in the file |
@xiaoxiang781216 @acassis @ramangopalan add PR #12671 @ramangopalan remember to comment out the directive '#warning' |
@simbit18 thank you very much! |
@ramangopalan please comment out the directive '#warning' and rebase, since the CI should be fixed now |
Dear NuttX community, Greetings!
Summary
This is an initial working commit for the Mizar32-A platform. It is
powered by the AT32UC3A0512 microcontroller. I started with the same
Microchip Studio project I used to verify avr32dev1 (NuttX 6.0) to
also fix the build and initial functionality for Mizar32-A.
For Mizar32, I had to fix the NuttX low level abstraction layer for
the clock, the PLL0, the USART pins' alternate functions and finally,
the USART clock source.
Impact
This PR won't affect the functionality of any other target. It won't
also affect the build OR code for the existing avr32dev1 target.
Testing
I checked the NuttX build on GNU/Linux. I used dfu-programmer to
verify `nsh' on Mizar32-A. It works great! I am attaching a snip from
my hack sessions.
Please let me know if the PR is alright OR if there's something I have
missed. Many thanks. Have a great weekend!