element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Path to Programmable
  • Challenges & Projects
  • Design Challenges
  • Path to Programmable
  • More
  • Cancel
Path to Programmable
Blog Path to Programmable - SW Labs 8 and 9 (Pardon my Interruption!)
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: aspork42
  • Date Created: 6 Jan 2019 5:19 AM Date Created
  • Views 624 views
  • Likes 3 likes
  • Comments 2 comments
  • xilinx
  • vivado
  • source control
  • sdk
Related
Recommended

Path to Programmable - SW Labs 8 and 9 (Pardon my Interruption!)

aspork42
aspork42
6 Jan 2019

In this post we get through labs 8 and 9. This will teach us how to archive a project and restore from archives; then it will discuss using interrupts in our programs.

 

About:

Through Avnet, Xilinx and Element14, a training program to learn about the Zynq 7000 platform which is System On Chip combining an FPGA with an ARM processor. This comes to the students as complete development board packed with goodies like a wireless chip from MuRata (BT/BTLE/WIFI), 8GB Flash memory, onboard RAM, USB to JTAG (JTAG programmable over USB), Arduino-style headers (3.3V compatible only), Microphone, Bi-Color LED, and two additional expansion ports.

 

See all blog posts for this training here.

 

Lab 8 - Archiving

This is all about the process of using source control with the SDK package. It is advised to never just simply zip the Windows folder and send that out as it likely will have a lot of problems. Each user's workplace preferences are unique.

 

For archiving the source files, this is pretty easy - File --> Export

image

"Archive file" under General is chosen. We then chose all the items to inlcude in the archive. As can be seen in the screenshot below, we picked everything. This will include all SW applications, FSBL, and Board Support Packages.

image

 

I got an error during the export as shown below; but the lab mentions that we may need to go back and do a "Refresh" before we export.

image

 

That did the trick for me - I was able to export after doing a refresh. It seems that a refresh does a build of the project; and for some reason redoing the build seems to make SDK happier.

 

We then follow through and export our Launch Configs and our Breakpoints as unique exports using almost the same methods as before.

 

image

 

I was curious about the files, so I took a peek. The breakpoint file is just an XML which spells out the filename and line number (and a bunch of other info) for each breakpoint.

 

<?xml version="1.0" encoding="UTF-8"?>
<breakpoints>
<breakpoint enabled="true" persistant="true" registered="true">
<resource path="/" type="8"/>
<marker charStart="-1" lineNumber="-1" type="org.eclipse.cdt.debug.core.cFunctionBreakpointMarker">
<attrib name="org.eclipse.cdt.debug.core.breakpointType" value="0"/>
<attrib name="org.eclipse.cdt.debug.core.ignoreCount" value="0"/>
<attrib name="org.eclipse.tcf.debug.tcfStamp" value="true"/>
<attrib name="requestedLine" value="-1"/>
<attrib name="charEnd" value="-1"/>
<attrib name="org.eclipse.debug.core.enabled" value="true"/>
<attrib name="org.eclipse.cdt.debug.core.installCount" value="0"/>
<attrib name="message" value="Function breakpoint:  [function: _exit]"/>
<attrib name="requestedSourceHandle" value=""/>
<attrib name="org.eclipse.debug.core.id" value="org.eclipse.cdt.debug.core"/>
<attrib name="org.eclipse.cdt.debug.core.sourceHandle" value=""/>
<attrib name="charStart" value="-1"/>
<attrib name="org.eclipse.cdt.debug.core.function" value="_exit"/>
<attrib name="org.eclipse.cdt.debug.core.condition" value=""/>
<attrib name="workingset_name" value=""/>
<attrib name="workingset_id" value="org.eclipse.debug.ui.breakpointWorkingSet"/>
</marker>
</breakpoint>
<breakpoint enabled="true" persistant="true" registered="true">
<resource path="/" type="8"/>
<marker charStart="-1" lineNumber="-1" type="org.eclipse.cdt.debug.core.cFunctionBreakpointMarker">
<attrib name="org.eclipse.cdt.debug.core.breakpointType" value="0"/>
<attrib name="org.eclipse.cdt.debug.core.ignoreCount" value="0"/>
<attrib name="org.eclipse.tcf.debug.tcfStamp" value="true"/>
<attrib name="requestedLine" value="-1"/>
<attrib name="charEnd" value="-1"/>
<attrib name="org.eclipse.debug.core.enabled" value="true"/>
<attrib name="org.eclipse.cdt.debug.core.installCount" value="0"/>
<attrib name="message" value="Function breakpoint:  [function: main]"/>
<attrib name="requestedSourceHandle" value=""/>
<attrib name="org.eclipse.debug.core.id" value="org.eclipse.cdt.debug.core"/> 1
<attrib name="org.eclipse.cdt.debug.core.sourceHandle" value=""/>
<attrib name="charStart" value="-1"/>
<attrib name="org.eclipse.cdt.debug.core.function" value="main"/>
<attrib name="org.eclipse.cdt.debug.core.condition" value=""/>
<attrib name="workingset_name" value=""/>
<attrib name="workingset_id" value="org.eclipse.debug.ui.breakpointWorkingSet"/>
</marker>
</breakpoint>
<breakpoint enabled="false" persistant="true" registered="true">
<resource path="/Test_Peripherals/src/testperiph.c" type="1"/>
<marker lineNumber="273" type="org.eclipse.cdt.debug.core.cLineBreakpointMarker">
<attrib name="org.eclipse.cdt.debug.core.breakpointType" value="0"/>
<attrib name="org.eclipse.cdt.debug.core.ignoreCount" value="0"/>
<attrib name="org.eclipse.tcf.debug.tcfStamp" value="true"/>
<attrib name="requestedLine" value="273"/>
<attrib name="org.eclipse.debug.core.enabled" value="false"/>
<attrib name="org.eclipse.cdt.debug.core.installCount" value="0"/>
<attrib name="message" value="Line breakpoint: testperiph.c [line: 273]"/>
<attrib name="requestedSourceHandle" value="C:\Speedway\ZyncSW\2017_4\SDK_Workspace\Test_Peripherals\src\testperiph.c"/>
<attrib name="org.eclipse.cdt.debug.core.condition" value=""/>
<attrib name="org.eclipse.cdt.debug.core.sourceHandle" value="C:\Speedway\ZyncSW\2017_4\SDK_Workspace\Test_Peripherals\src\testperiph.c"/>
<attrib name="org.eclipse.debug.core.id" value="org.eclipse.cdt.debug.core"/>
<attrib name="workingset_name" value=""/>
<attrib name="workingset_id" value="org.eclipse.debug.ui.breakpointWorkingSet"/>
</marker>
</breakpoint>
</breakpoints>

 

 

See for instance lines 45-47:

<breakpoint enabled="false" persistant="true" registered="true">
<resource path="/Test_Peripherals/src/testperiph.c" type="1"/>
<marker lineNumber="273" type="org.eclipse.cdt.debug.core.cLineBreakpointMarker">

 

And this matches our breakpoints from the SDK / Debug view -

image

 

The "run Configs" file was very similar.

They note here that to export our workspace preferences do still require manually backing up the windows folder; so we go to the subfolder and copy-paste the preference files into a new Backups folder.

 

That completes the archiving process! Most was very easy as there is a wizard which guides you through it.

 

We switch SDK to a new 'workspace' which is like starting fresh - there are no applications, HDLs; BSPs, or anything else.

 

Importing the files is basically the same in reverse - File --> Import ; chose file then hit OK.

 

Most the files that we archived were pretty small in size. The main backup which include the programs was about 6 mb; the rest were between 1-4k. These could all be used to check in/ out from a Source control program. I wonder if Vivado or SDK can integrate directly with things like TFS or GIT... Anyone?

 

Lab 9 - Interrupts

Interrupts are a good way to catch things which happen quickly without impacting too much main code - for hardware this could be for things like an encoder input or button press. We don't want to have to continually scan buttons for transitions and would rather just use an interrupt. This essentially works like a hardware input which; when asserted; has a dedicated function of code to deal with the input. For something like a button; the interrupt would fire code to say "something happened" and the Interrupt Service Routine (ISR) code block will execute. Typically, ISRs should be written to be 'short and sweet'. This is because they are essentially 'blocking' code and we need to get the processor back to the original task. When the interrupt fires, the processor has to stack up all its current tasks, handle the interrupt, then un-stack everything and keep going. Xilinx even mentions that they have different types of interrupts which can do things like enhance power saving if they are waiting on a resource like memory. That means that one should never use a 'delay' in an ISR; and we would typically just update a variable then exit the ISR and let the regular program take back over.

 

In this example. we re-open the PWM lesson from earlier; but the 'non-interrupted' version. In this, we let the hardware side handle invalid input to PWM brightness levels. The software code is then updated to include interrupt handling. The interrupt itself still comes from the PL side; but the software does the code execution when this occurs.

 

There wasn't too much else to this lesson other than that. I did notice (again) that there is a bug in this example code - see the screenshot below.

image

 

The word 'select' has the letter 's' dropped every time an interrupt occurs. My guess is this has to do with timing as the processor comes out of the interrupt routine; but I'm not sure.

 

I should be finishing up the last two labs tomorrow and starting on my project! Parts won't be here for a few more days, but I think I'll be OK.

  • Sign in to reply
Parents
  • DAB
    DAB over 6 years ago

    Nice update.

    I wonder if the output is looking for a control character first, which would explain the drop of the s. Have you tried putting a space at the front of the text?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • aspork42
    aspork42 over 6 years ago in reply to DAB

    That's exactly it - I put an underscore ahead of the word "select" and it gets dropped off.

    I wonder if Avnet / Xilinx has a response for this?

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • aspork42
    aspork42 over 6 years ago in reply to DAB

    That's exactly it - I put an underscore ahead of the word "select" and it gets dropped off.

    I wonder if Avnet / Xilinx has a response for this?

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube