Code Monkey home page Code Monkey logo

Comments (4)

c4chris avatar c4chris commented on July 17, 2024

You need to allocate memory before calling tx_thread_create, e.g.

CHAR *pointer;

ret = tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_STACK_SIZE, TX_NO_WAIT);

ret = tx_thread_create(&my_thread, "My Thread", my_thread_entry, 0, pointer, DEFAULT_STACK_SIZE, DEFAULT_THREAD_PRIO,
                  DEFAULT_PREEMPTION_THRESHOLD, TX_NO_TIME_SLICE, TX_AUTO_START);

You might want to check the value of ret after each call

from x-cube-azrtos-h7.

zsjlovestudy avatar zsjlovestudy commented on July 17, 2024

CHAR *pointer;

ret = tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_STACK_SIZE, TX_NO_WAIT);

thank you very much! I was careless and tried Azure for the first time.

from x-cube-azrtos-h7.

zsjlovestudy avatar zsjlovestudy commented on July 17, 2024

You need to allocate memory before calling tx_thread_create, e.g.

CHAR *pointer;

ret = tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_STACK_SIZE, TX_NO_WAIT);

ret = tx_thread_create(&my_thread, "My Thread", my_thread_entry, 0, pointer, DEFAULT_STACK_SIZE, DEFAULT_THREAD_PRIO,
                  DEFAULT_PREEMPTION_THRESHOLD, TX_NO_TIME_SLICE, TX_AUTO_START);

You might want to check the value of ret after each call

May I ask you another question, if I choose dynamic memory allocation, how should I allocate for it?

image
image

from x-cube-azrtos-h7.

ALABSTM avatar ALABSTM commented on July 17, 2024

Hi @zsjlovestudy,

Your questions are more than welcome. However, the right channel to ask for support about such aspects is the ST Community via a post on the Azure RTOS dedicated section.

This channel is rather dedicated to report bugs or enhancements related to the firmware published within this repo.

Please allow me to close this issue. Thank you for your comprehension.

With regards,

from x-cube-azrtos-h7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.