Become a leader in the IoT community!

New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!

Step 1 of 5

CREATE YOUR PROFILE *Required

Change Email
OR
Step 2 of 5

WHAT BRINGS YOU TO DEVHEADS? *Choose 1 or more

Collaboration & Work 🤝
Learn & Grow 📚
Contribute Experience & Expertise 🔧
Step 3 of 5

WHAT'S YOUR INTEREST OR EXPERTISE? *Choose 1 or more

Hardware & Design 💡
Embedded Software 💻
Edge Networking
Step 4 of 5

Personalize your profile

Step 5 of 5

Read & agree to our COMMUNITY RULES

  1. We want this server to be a welcoming space! Treat everyone with respect. Absolutely no harassment, witch hunting, sexism, racism, or hate speech will be tolerated.
  2. If you see something against the rules or something that makes you feel unsafe, let staff know by messaging @admin in the "support-tickets" tab in the Live DevChat menu.
  3. No age-restricted, obscene or NSFW content. This includes text, images, or links featuring nudity, sex, hard violence, or other graphically disturbing content.
  4. No spam. This includes DMing fellow members.
  5. You must be over the age of 18 years old to participate in our community.
  6. Our community uses Answer Overflow to index content on the web. By posting in this channel your messages will be indexed on the worldwide web to help others find answers.
  7. You agree to our Terms of Service (https://www.devheads.io/terms-of-service/) and Privacy Policy (https://www.devheads.io/privacy-policy)
By clicking "Finish", you have read and agreed to the our Terms of Service and Privacy Policy.

i am getting error after calling vTaskStartScheduler();

i am getting error after calling ` vTaskStartScheduler();`

  1. undefined2001#0000

    Can anyone help

  2. undefined2001#0000

    I googled a bit they says it is an issue with the `Vector Table Location`

  3. undefined2001#0000

    but according to my compiled program
    image.png

  4. undefined2001#0000

    it is already on the right location

  5. marveeamasi#0000

    I don’t know if the compiler and linker settings are configured correctly to place the .isr_vector section at the appropriate address

  6. undefined2001#0000

    yes it is

  7. undefined2001#0000

    i keep isr always at the top

  8. undefined2001#0000

    also if it was wrong how I can reach main

  9. undefined2001#0000

    reset handler also resides inside the vector table

  10. marveeamasi#0000

    Well I haven’t encountered something like this , what’s actually the error

  11. undefined2001#0000

    after this function called mcu goes into hardfault

  12. marveeamasi#0000

    From what I know freeRTOS uses multiple stacks, one for each tasks , and an incorrectly sized stack for the tasks can lead to a hardfault

  13. marveeamasi#0000

    If the task stack size is too small, maybe increase it

  14. undefined2001#0000

    noted. I will try tomorrow

  15. Techist#0000

    Try increasing your stack size.
    How many tasks/thread do you intend to create?

  16. undefined.elf#0000

    each stack size was 4kb

  17. undefined.elf#0000

    I thing that was enough

  18. undefined.elf#0000

    the error mostprobably some ISR thing

  19. metro04776#0000

    Are you using any interrupt service routine for any other peripheral in your project? Say UART?

  20. undefined2001#0000

    Now it is working fine and I am using uart for debugging

  21. metro04776#0000

    Ok, mind to share how you fixed it?

  22. undefined2001#0000

    the issue was how I treated FreeRTOS

  23. undefined2001#0000

    i added rtos as a library to my project

  24. undefined2001#0000

    for that reason when compiling ISRs weren’t linked perfectly

  25. undefined2001#0000

    since ISR’s are weekly declared so if my linker found them first their symbols are resolved and it won’t look for strongly implemented ISR’s which were implemented by FreeRTOS

  26. undefined2001#0000

    for that I added FreeRTOS as a source to my code

  27. metro04776#0000

    Ohhhhh, that makes much sense.

  28. undefined2001#0000

    and everything working just fine

  29. metro04776#0000

    You could use Cubemx next time to avoid such problem.

  30. undefined2001#0000

    To be honest I am more comfortable in this way

  31. undefined2001#0000

    Every time I face some issues like this

  32. undefined2001#0000

    it teaches me a lot

  33. metro04776#0000

    It’s fine, then.

    That’s how I learnt FreeRTOS my self.

  34. undefined2001#0000

    For example I learned this because of the issue

  35. metro04776#0000

    I only suggested using cubemx because it’s more easier to use.

    And it does all configurations underhood for you.

  36. undefined2001#0000

    I know that maybe for rapid development I will use it but i am still learning

  37. undefined2001#0000

    so for now I will give it a try

  38. undefined2001#0000
  39. undefined2001#0000

    in case if you want to share some of your words in this

  40. metro04776#0000

    Perfect.

    Been awhile I worked on freeRTOS though.

  41. undefined2001#0000

    even though it doesn’t make much sense but I love to write my own driver

  42. metro04776#0000

    I see you are using uart for logging purpose right?

    Where are you calling the uart write function?

    _io_puts private function?

  43. undefined2001#0000

    no

  44. undefined2001#0000

    you can check debug.c

  45. undefined2001#0000

    for better information

  46. undefined2001#0000

    _io_puts is called by a system call which is _write that is kinda overhead to what i exactly need

  47. undefined2001#0000

    so I just wrote my printk to do the job

  48. metro04776#0000

    Yeah, I get you.

    That’s fine.

    You should define your mask values and bit positions as macros too.

    You’d have a hard time understanding that code in months to come.

  49. undefined2001#0000

    in which file?

  50. undefined2001#0000

    in main.c those configurations I did it was for rapid testing

  51. undefined2001#0000

    I usually use CMSIS so those are already defined

  52. metro04776#0000

    Placing your uart write in io_puts should be able to achieve the same result.

    I think so.

  53. undefined2001#0000

    yeah no doubt about it

  54. metro04776#0000

    Ooh, makes much sense.

    Yeah, I saw you your cmsis lib.

  55. metro04776#0000

    Kudos

  56. undefined2001#0000

    but printf is invoking some system call which is more resource hungry so I get the functionality I need but a bit less cost

  57. undefined2001#0000

    in the past I used to call my uart_send_char inside _io_putchar

  58. undefined2001#0000

    also printf might use a larger buffer to store data i only made my buffer for 100 characters

  59. undefined2001#0000

    which is more than enough to logging data

  60. metro04776#0000

    Well, the printk implementation is fine anyways.

    It’s justiable if you are using it for learning purpose.

  61. undefined2001#0000

    also i thought it would better rather than sending character by character in each _io_putchar call

  62. undefined2001#0000

    I am sending it as a buffer

  63. undefined2001#0000

    <:excusemewhat:1140055557483544667>

  64. metro04776#0000

    Your uart driver still sends it per character, lol.

  65. undefined2001#0000

    yeah but in a single function call

  66. metro04776#0000

    So it doesn’t make much difference, lol

  67. undefined2001#0000

    maybe but it was one of my initial thoughts

  68. metro04776#0000

    It’s entirely fine.

    I need to join a meeting now.
    I’m glad to know that you fixed your bugs.

    Happy building.

  69. undefined2001#0000

    thanks man🫡

  70. undefined2001#0000

    it feels really good to share the process with someone

CONTRIBUTE TO THIS THREAD

Browse other questions tagged