Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

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

Altera_Forum
Honored Contributor II
1,523 Views

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.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
439 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
439 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
439 Views

Thanks Cindy, 

I will check this out and provide you with the updates 

 

Regards 

Chandramohan
0 Kudos
Reply