From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Using MCU 8051 in Multisim 14.2 - linker error

 

The compiler may still require the const access modifier, in that case the declarations should be like these:

 

rom const int i_arr[4][4] = {{0,1,1,1},{1,0,1,1},{1,1,0,1},{1,1,1,0}};

 

rom const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

 

rom const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

0 Kudos
Message 11 of 15
(666 Views)

Still comes back with:

 

Multisim - 21 April 2021, 09:53:22
-------------------------Building: Project: Calculator--------------------------
Note: -E compiler option was not present. This option has been added to the compiler build command temporarily.
Note: -O compiler option was not present. This option has been added to the compiler build command temporarily.
Error: C:\Users\Dad Laptop\Documents\National Instruments\Circuit Design Suite 14.2\MCU Workspaces\Calculator\Calculator\Calculator8052.c : 22 undefined identifier "rom"

0 Kudos
Message 12 of 15
(664 Views)

 

Can you post the error message(s) when I suggested using const and code declaration modifiers (refer to one of my previous replies)? If the error(s) involve i_arr only, you can try using const or/and code declaration modifiers in c_arr and error only:

 


const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

 

const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

 

or

 

code char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

 

code char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

 

or

 

code const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

 

code const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

0 Kudos
Message 13 of 15
(652 Views)

Hi

I've tried all the variations and it seems to still give the two linker errors.

 

See the results below:

 

 

const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

Compiler results: 0 - Errors, 0 - Warnings
Linking...
Error: : 0 psect "rbss" exceeds address limit: 08Ch > 080h
Error: : 0 psect "rdata" exceeds address limit: 08Ch > 080h
Linker results: 2 - Errors, 0 - Warnings

 

code char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

code char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

National Instruments\Circuit Design Suite 14.2\MCU Workspaces\Calculator\Calculator\Calculator8052.c : 28 auto variable "error" should not be qualified
Compiler results: 0 - Errors, 1 - Warnings
Linking...
Error: : 0 psect "rbss" exceeds address limit: 08Ch > 080h
Error: : 0 psect "rdata" exceeds address limit: 08Ch > 080h
Linker results: 2 - Errors, 0 - Warnings

 

 

code const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

code const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

National Instruments\Circuit Design Suite 14.2\MCU Workspaces\Calculator\Calculator\Calculator8052.c : 28 auto variable "error" should not be qualified
Compiler results: 0 - Errors, 1 - Warnings
Linking...
Error: : 0 psect "rbss" exceeds address limit: 08Ch > 080h
Error: : 0 psect "rdata" exceeds address limit: 08Ch > 080h
Linker results: 2 - Errors, 0 - Warnings

Message 14 of 15
(646 Views)

 

The error messages are important, the modifications that we try are based on these messages. The code and/or const declaration modifiers may give us hope to successfully build this code. Try relocating the declarations of c_arr and error between #include <htc.h> and function declarations. Again, try the three variants I mentioned in my previous reply:

 

 

 

#include <htc.h>

 

code const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

code const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

/******Function declaration******/

 

 

 

or

 

 

#include <htc.h>

 

code char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

code char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

/******Function declaration******/

 

 

 

or

 

 

#include <htc.h>

 

const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};

const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};

 

/******Function declaration******/

 

 

 

You don't have to delete the original declarations inside main(), simply comment them out:

 

 

void main()
{

/* char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}}, error[10]={'M','A','T','H',' ','E','R','R','O','R'}; */

}

 

 

 

Post any changes in error messages, if they are too long you can opt to attach them as file instead of inline text.

 

0 Kudos
Message 15 of 15
(623 Views)