1 proc swapp_get_name {} {
2 return "FreeRTOS Hello World";
5 proc swapp_get_description {} {
6 return "Let's say 'Hello World' in FreeRTOS.";
10 set oslist [xget_sw_modules "type" "os"];
11 set os [lindex $oslist 0];
14 error "No Operating System specified in the Board Support Package.";
22 set stdout [xget_sw_module_parameter $os "STDOUT"];
26 proc check_stdout_hw {} {
27 set p7_uarts [xget_ips "type" "ps7_uart"];
28 set uartlites [xget_ips "type" "uartlite"];
29 set uart16550s [xget_ips "type" "uart16550"];
30 if { ([llength $p7_uarts] == 0) && ([llength $uartlites] == 0) &&
31 ([llength $uart16550s] == 0) } {
32 # Check for MDM-Uart peripheral. The MDM would be listed as a peripheral
33 # only if it has a UART interface. So no further check is required
34 set mdmlist [xget_ips "type" "mdm"]
35 if { [llength $mdmlist] == 0 } {
36 error "This application requires a Uart IP in the hardware."
41 proc check_stdout_sw {} {
42 set stdout [get_stdout];
43 if { $stdout == "none" } {
44 error "The STDOUT parameter is not set on the OS. Hello World requires stdout to be set."
48 proc swapp_is_supported_hw {} {
49 # check for uart peripheral
55 proc swapp_is_supported_sw {} {
56 # check for stdout being set
62 proc generate_stdout_config { fid } {
63 set stdout [get_stdout];
65 # if stdout is uartlite, we don't have to generate anything
66 set stdout_type [xget_ip_attribute "type" $stdout];
68 if { [regexp -nocase "uartlite" $stdout_type] || [string match -nocase "mdm" $stdout_type] ||
69 [regexp -nocase "ps7_uart" $stdout_type]} {
71 } elseif { [regexp -nocase "uart16550" $stdout_type] } {
72 # mention that we have a 16550
73 puts $fid "#define STDOUT_IS_16550";
75 # and note down its base address
77 set postfix "_BASEADDR";
78 set stdout_baseaddr_macro $prefix$stdout$postfix;
79 set stdout_baseaddr_macro [string toupper $stdout_baseaddr_macro];
80 puts $fid "#define STDOUT_BASEADDR $stdout_baseaddr_macro";
84 proc generate_cache_mask { fid } {
85 set mask [format "0x%x" [xget_ppc_cache_mask]]
86 puts $fid "#ifdef __PPC__"
87 puts $fid "#define CACHEABLE_REGION_MASK $mask"
91 # depending on the type of os (standalone|xilkernel), choose
92 # the correct source files
93 proc swapp_generate {} {
96 if { $os == "xilkernel" } {
97 file rename -force "helloworld_xmk.c" "helloworld.c"
99 file delete -force "helloworld_xmk.c"
102 # cleanup this file for writing
103 set fid [open "platform_config.h" "w+"];
104 puts $fid "#ifndef __PLATFORM_CONFIG_H_";
105 puts $fid "#define __PLATFORM_CONFIG_H_\n";
107 # if we have a uart16550 as stdout, then generate some config for that
108 generate_stdout_config $fid;
110 # for ppc, generate cache mask string
111 generate_cache_mask $fid;
117 proc swapp_get_linker_constraints {} {
118 # this app does not require a .vectors section if it is being run w/ the standalone OS on PPC
121 if { $os == "standalone" } {
122 return "vector_section no";