Locale Icon
English
  • Forums

    Popular Forums

    • LTspice
    • Video
    • Power Management
    • RF & Microwave
    • Precision ADCs
    • FPGA Reference Designs

    Product Forums

    • Amplifiers
    • Clocks & Timers
    • Data Converters
    • Direct Digital Synthesis (DDS)
    • Energy
    • Interface and Isolation
    • MEMS Inertial Sensors
    • Power Management
    • Processors & DSP
    • Processors & Microcontrollers
    • Switches & Multiplexers
    • Sensors
    • Voltage References
    View All

    Application Forums

    • A2B Audio Bus
    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • Embedded Vision Sensing Library
    • Motor Control Hardware Platforms
    • Precision Technology Signal Chains Library
    • Video
    • Wireless Sensor Networks Reference Library

    Design Center Forums

    • ACE Evaluation Software
    • ADEF System Platforms
    • Design Tools & Calculators
    • FPGA Reference Designs
    • Linux Software Drivers
    • Microcontroller no-OS Drivers
    • Precision Studio
    • Power Studio Designer
    • Power Studio Planner
    • Reference Designs
    • Robot Operating System (ROS) SDK
    • Signal Chain Designer
    • Software Interface Tools
  • Learn

    Highlighted Webinar

    COTS SoMs & Phased Array Solutions for Rapid RF Subsystem Integration

    Accelerate RF Subsystem Integration with COTS SoMs and Phased Array Solutions. As building a subsystem from early prototype to full deployment is never...

    Places

    • ADI Academy
    • ADI Webinars
    • EZ Blogs
    • Video Annex
    • Virtual Classroom

    Libraries

    • 3D ToF Depth Sensing Library
    • Continuous-Wave CMOS Time of Flight (TOF) Library
    • Embedded Vision Sensing Library
    • Gigabit Multimedia Serial Link (GMSL) Library
    • Optical Sensing Library
    • Other Products Library
    • Precision Technology Signal Chains Library
    • Software Modules and SDKs Library
    • Supervisory Circuits Library
    • Wireless Sensor Networks Library

    Upcoming Learning & Events

    • Humanoid Robotics: Deterministic Motion Control & Edge AI Systems
    • Power Integrity for High Performance Measurement Systems
    • Open RAN 5G Radio Design: SDR SoCs for Energy-Efficient, Secure Deployments
    View All Webinars
  • Community Hub

    Challenge Yourself!

      KCC's Quiz AQQ300 about Divisibility by 6

      1. Quote of the month: " Friendship is like money - easier made than kept " - Samuel Butler 2. New quiz AQQ300 about a divisibility by 6 puzzle ...

    View All

    What's Brewing

      Read a Blog, Take this Quiz for Another Chance to Win a Gift Card!

      Important: Read the blog first . The quiz questions are all based on the content of the blog: Taming the AI Power Storm: Part 2 of 3 Test your...

    View All

    Places

    • Community Help
    • Analog Dialogue Quiz
    • Logic Lounge
    • Super User Program

    Resources

    • EZ Code of Conduct
    • EZ How To Help Articles
    • Getting Started Guide
    • ADI: Words Matter
    • Community Help Videos
    View All
  • ContentZone

    Visit ContentZone

    Search content by industry or technology.
    • Blogs
    • Technical Articles
    • Tutorials
    • Videos
    • Webinars
    Your ADI content all in one place.
    View ContentZone

    The Latest Read

    JESD204 Bring-Up: From Link-Up to Data Integrity

    This blog presents a structured bring-up methodology for the ZCU102 + ADRV9009 platform, stepping through each initialization phase in sequence and identifying...

    New Release

    Signal Chain Designer: DC Error Simulation
    Signal Chain Designer: DC Error Simulation

    This video covers the DC error calculation capabilities of Signal Chain Designer. DC error is unique in that often requires calibration and has so many...

    Recent Technical Insights

    Latest Technical Article from Analog.com
    Phase Sync in Digital Phased Arrays Through Direct RF SamplingPart 2: Achieving Phase Repeatability

    This article discusses a methodology to synchronize multiple modular circuit boards, equipped with high speed data converters, to build a concept of a...

EngineerZone
EngineerZone
VisualDSP++ Development Tools
  • Log In
  • User
  • Site
  • Search
OR
Ask a Question
VisualDSP++ Development Tools
  • Processors & DSP
  • Software & Development Tools
  • VisualDSP++ Development Tools
  • Cancel
VisualDSP++ Development Tools
Documents Question about VDK heap
  • Q&A
  • Documents
  • Members
  • Tags
  • Cancel
  • Documents
  • +ADSP-21369 EZ-KIT: FAQ
  • +ADSP-BF506F: FAQ
  • +ADSP-BF592: FAQ
  • +Blackfin: FAQ
  • +DXE: FAQ
  • +How to Resolve [Error li1040]: FAQ
  • +HP-USB-ICE Emulator: FAQ
  • +ICE1000: FAQ
  • Is it possible to convert my existing floating license to node-locked license or vice versa?
  • +Project Building Error: FAQ
  • +Reset, Reload and Restart: FAQ
  • +SHARC simulator: FAQ
  • Ticks for VDK_Sleep()
  • -VDK heap: FAQ
    • Question about VDK heap
  • +VisualDSP++: FAQ
  • +Windows 8.1: FAQ

Question about VDK heap

Question:

I'm new to VDK .I have a question about VDK heap.

How to define a heap in SDRAM and how to link heap id to address?

How to make a thread use heap by defined in kernal tab heaps,or I have to use heap_malloc to instead of new?

Is there a example about VDK heap use?

==============================

Answer:

As a start up please refer the manual given in the VDSP help path >Manuals>Software and tools manual>VDK manual which might help you work with VDK.

The heap can be placed into external memory like SDRAM from the "LDF Settings: System Heap" menu in the Project options. Select "Customize the system heap?" and then select "L3 external memory (SDRAM)" and increase the minimum size if required.

As you are using VDK, we recommend to read the "Memory Pools" section in the VDK manual. You can find this in VisualDSP++ Help menu: 'Help' - 'Contents' - 'Graphical Environment' - 'VDK' - 'How To' - 'Configuring VDK' - 'Memory Pools'

Also adding a heap in the VDK kernel tab makes VDK aware of existing heaps but it does not create a new heap on its own. In order to create a new heap the easiest is to use a generated CRT and LDF and add the heap there. This means that the process of using a user heap in VDK consists of two steps: adding the heap to the project and declaring it to VDK.


1.       Add a user heap to the project

-          With Generated Startup Code/LDF.
 To add the generated LDF you need to go to the Project Options-> Add Startup Code/LDF. Once you have the startup code/LDF then you will see in the Project Options User Heap under LDF Settings.

-          Without Generated Startup Code/LDF
You need to add a heap table file to your project. The heap table would look something like this (if you write it in C)
extern "asm" int ldf_heap_space;
extern "asm" int ldf_heap_length;
extern "asm" int MySDRAMHeap_space;
extern "asm" int MySDRAMHeap_length;

struct heap_table_t
{
  void          *base;
  unsigned long  length;
  long int       userid;
};

struct heap_table_t heap_table[3] = /* 3 would be higher if you had more than 1 user heap */
{
  { &ldf_heap_space, (unsigned long) &ldf_heap_length, 0 },
  { &MySDRAMHeap_space, (unsigned long) &MySDRAMHeap_length, 1 }, /* the user ID must increase in each iteration by 1 */
  { 0, 0, 0 }
};

And in the LDF you would have to allocate the space for your heap. For example for a fixed size 8k in L3 you would add in your L3 memory space:
         RESERVE(heaps_and_stack_in_L3_bank3, heaps_and_stack_in_L3_bank3_length = 8192,4)
         MySDRAMHeap_space = heaps_and_stack_in_L3_bank3;
         MySDRAMHeap_end = (MySDRAMHeap_space + (heaps_and_stack_in_L3_bank3_length - 4)) & 0xfffffffc;
         MySDRAMHeap_length = MySDRAMHeap_end - MySDRAMHeap_space;

2.       Declare to VDK that you want to use a user heap
In the VDK kernel tab in the Heaps node right click onto New Heap. The name of the heap is specific to VDK so you can choose what you want and does not have to match the heap table. The heap ID is the user ID specified as the third member of the heap_table_t structure for the heap that you are interested in.
Doing this will show your user heap in the list of heaps that you can allocate from in the kernel tab. You can also use this heap in VDK APIs that take a heap with the k prefix.

  • Share
  • History
  • More
  • Cancel
analog-devices logo

About Analog Devices

  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
  • Instagram page
  • Twitter page
  • Linkedin page
  • Youtube page
  • Facebook
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2026 Analog Devices, Inc. All Rights Reserved

analog-devices

About Analog Devices

Down Up
  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

Down Up
  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
Instagram page Facebook Twitter page Linkedin page Youtube page
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2026 Analog Devices, Inc. All Rights Reserved