Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Running microC/OS-II from onchip memory

I have a Quartus 10.1 SOPC design with a nios2 running out of on chip memory. The nios2's reset vector points to the onchip memory with offset 0x0. The exception vector points to a separate onchip memory. I have a software project based on the simple_socket_server template that runs if I download the image over jtag. I would like to be able to assemble a sof with a .hex file that contains my image for the onchip memory that will run by simply programming the sof. I can build a simple HAL layer hello_world app that works this way. I just create the hex file run update memory initial file from quartus and reassembly the sof. When I program this sof over jtag the software runs without any problems. When I do the same thing with the simple_socket_server app it does not run. Does anybody have any ideas on why the simple HAL app runs but the more complicated MicroC/OS-II based simple_socket_server app does not?

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I built the "Hello MicroC/OS-II" app from the template it works OK. So I don't think it is an issue with MicroC/OS-II. Maybe an issue with the interniche stack in the simple_socket_server example?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Is your design fully contained in onchip memory or do you have any other memory devices, I mean for data, stack...

    Is the behavior the same if you place reset and exception vectors in the same memory?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes everything except the exception_ram is in the same ram. I have a separate exception ram. I was comparing the BSP settings for the uc/osii hello world and under Main\Advanced\hal\linker the hello_world app has everthing but 'enbale_alt_load_copy_rodata' check. My project didn't have anything checked. I rebuilt with the same options selected and I got the follow message over the jtag_uart:

    starting main processafter OSTimeSetafter alt_uCOSIIErrorAfter OSStart

    Then no other output after that. I don't know if this is helpful.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The errors I was getting were because I had commented out OSStart in the main. It is working now the problem was the BSP settings. Most likely is the 'allow_code_at_reset' option. Thanks for your help.