Forum Discussion

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

Modify/Add a new Function to existing BSP/HAL Driver

Can someone Help with the steps involved in modifying an existing bsp/HAL driver for Nios.

I need to add few Features in the exiting driver. I cannot even add print statements as the "generate BSP" would overwrite all of my changes.

Please provide me with detailed steps.

3 Replies

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

    You shouldn't be changing the auto generated HAL drivers. If you want to add your own custom files start a new .h and .c files in your project folder and# include the generated HAL files (or not if you don't want to use the auto generated drivers).

    If you don't include a driver in your main program then it won't be used. You can make your own drivers (by including system.h) as described above.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, I've managed to do this. I've written a very basic Avalon-Memory-Mapped component with a few registers which I wanted to incorporate into a .qsys file and be seen by a Nios. Attached in the zip file is the component "avalonmm_regspace_vhdl.hdl" and the .tcl files required to incorporate it into the hardware " avalonmm_regspace_vhdl_hw.tcl" and then the software (ie. driver) "avalonmm_regspace_vhdl_sw.tcl". In Eclipse as long as when you generate your BSP it looks into the directory containing the ..._sw.tcl file it should incorporate the driver into a "driver" directory.

    Hope this helps.

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

    Thanks Cindy,

    I will check this out and provide you with the updates

    Regards

    Chandramohan