Awesome Contents

Fun with Pointers & Printing

Fun with Pointers & Printing ⚠ Click here to regain focus ⚠
?
?

Keyboard Navigation

Global Keys

W, A, P / S, D, N Jump to previous / next marker
z Toggle filter mode V Revert filter to original state

Menu toggling

q Quotes r References f Filter c Credits

Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Credits Menu

Enter Open URL (in new tab)
0:19Recap and set the stage for the day
0:19Recap and set the stage for the day
0:19Recap and set the stage for the day
0:45Consult DrewatSiFive's reply to the forum post1
0:45Consult DrewatSiFive's reply to the forum post1
0:45Consult DrewatSiFive's reply to the forum post1
3:27Pointer assignment2
3:27Pointer assignment2
3:27Pointer assignment2
8:46The Privileged spec is up in the air3
8:46The Privileged spec is up in the air3
8:46The Privileged spec is up in the air3
9:46printf4
9:46printf4
9:46printf4
12:20Run the hello world program to determine that we have a working printf()
12:20Run the hello world program to determine that we have a working printf()
12:20Run the hello world program to determine that we have a working printf()
13:17hossein1387 Yeah, it works for me too. Magic
13:17hossein1387 Yeah, it works for me too. Magic
13:17hossein1387 Yeah, it works for me too. Magic
13:33Fix up the *config_string assignment in print_instructions()
13:33Fix up the *config_string assignment in print_instructions()
13:33Fix up the *config_string assignment in print_instructions()
16:45Consult man 3 fflush and man 2 write
16:45Consult man 3 fflush and man 2 write
16:45Consult man 3 fflush and man 2 write
18:43Comment out the fflush(), make clean, compile and upload
18:43Comment out the fflush(), make clean, compile and upload
18:43Comment out the fflush(), make clean, compile and upload
19:33Run our demo_gpio.c program and view the output
19:33Run our demo_gpio.c program and view the output
19:33Run our demo_gpio.c program and view the output
20:38Change the printf() to print a string
20:38Change the printf() to print a string
20:38Change the printf() to print a string
24:29Run and see no output
24:29Run and see no output
24:29Run and see no output
25:22Compare the difference between printf() in gpio_demo.c and in hello.c
25:22Compare the difference between printf() in gpio_demo.c and in hello.c
25:22Compare the difference between printf() in gpio_demo.c and in hello.c
26:46Compare the Makefiles
26:46Compare the Makefiles
26:46Compare the Makefiles
27:26hossein1387 Can you try to clean your env? Because it works for me
27:26hossein1387 Can you try to clean your env? Because it works for me
27:26hossein1387 Can you try to clean your env? Because it works for me
27:50Run make software_clean and remove the fflush()
27:50Run make software_clean and remove the fflush()
27:50Run make software_clean and remove the fflush()
28:45Run the program to see inconsistent writing
28:45Run the program to see inconsistent writing
28:45Run the program to see inconsistent writing
29:34hossein1387 I tried this in beginning of print_instructions(): unsigned char * ConfigString = (unsigned char*)*(volatile uint32_t *) 0x0000100C; printf("%s", ConfigString);
29:34hossein1387 I tried this in beginning of print_instructions(): unsigned char * ConfigString = (unsigned char*)*(volatile uint32_t *) 0x0000100C; printf("%s", ConfigString);
29:34hossein1387 I tried this in beginning of print_instructions(): unsigned char * ConfigString = (unsigned char*)*(volatile uint32_t *) 0x0000100C; printf("%s", ConfigString);
30:40Consult man 3 printf
30:40Consult man 3 printf
30:40Consult man 3 printf
31:51Make printf() print the address of config_string
31:51Make printf() print the address of config_string
31:51Make printf() print the address of config_string
32:37Run our program and view the output
32:37Run our program and view the output
32:37Run our program and view the output
34:51Note how inconsistent the writing is
34:51Note how inconsistent the writing is
34:51Note how inconsistent the writing is
35:39Consult man 3 printf again
35:39Consult man 3 printf again
35:39Consult man 3 printf again
37:53Try casting config_string to void*
37:53Try casting config_string to void*
37:53Try casting config_string to void*
39:40Run our program and receive the same address
39:40Run our program and receive the same address
39:40Run our program and receive the same address
40:02Set config_string without casting
40:02Set config_string without casting
40:02Set config_string without casting
40:50Run and receive the 0x100c address we were expecting
40:50Run and receive the 0x100c address we were expecting
40:50Run and receive the 0x100c address we were expecting
42:26Set config_string with the cast again
42:26Set config_string with the cast again
42:26Set config_string with the cast again
44:00Run our program to see our output, with a few words on pointer dereferencing
44:00Run our program to see our output, with a few words on pointer dereferencing
44:00Run our program to see our output, with a few words on pointer dereferencing
45:20Remember switching the jumper5
45:20Remember switching the jumper5
45:20Remember switching the jumper5
47:46Run and view our output
47:46Run and view our output
47:46Run and view our output
48:02Try to make print_instructions() write out the config_string using write()
48:02Try to make print_instructions() write out the config_string using write()
48:02Try to make print_instructions() write out the config_string using write()
48:41Run the program and view our correct config_string output, with a few words on where we got the config_string location
48:41Run the program and view our correct config_string output, with a few words on where we got the config_string location
48:41Run the program and view our correct config_string output, with a few words on where we got the config_string location
50:11Try printing from 0x00020004
50:11Try printing from 0x00020004
50:11Try printing from 0x00020004
53:35Run the program to see nothing at that memory location
53:35Run the program to see nothing at that memory location
53:35Run the program to see nothing at that memory location
54:18Consult the Pinout diagram in the Getting Started Guide6
54:18Consult the Pinout diagram in the Getting Started Guide6
54:18Consult the Pinout diagram in the Getting Started Guide6
57:51Read about the HiFive1 Boot Sequence7
57:51Read about the HiFive1 Boot Sequence7
57:51Read about the HiFive1 Boot Sequence7
59:43Read about OTP Contents8
59:43Read about OTP Contents8
59:43Read about OTP Contents8
1:02:29Try to print the Board Identifier
1:02:29Try to print the Board Identifier
1:02:29Try to print the Board Identifier
1:05:35Run our program and see garbage output
1:05:35Run our program and see garbage output
1:05:35Run our program and see garbage output
1:06:02Try to verify that 0x100C prints
1:06:02Try to verify that 0x100C prints
1:06:02Try to verify that 0x100C prints
1:07:44Run the program to see that it worked, and determine that the Board Identifier is not a string
1:07:44Run the program to see that it worked, and determine that the Board Identifier is not a string
1:07:44Run the program to see that it worked, and determine that the Board Identifier is not a string
1:09:41Try to printf() the board_id as an unsigned int
1:09:41Try to printf() the board_id as an unsigned int
1:09:41Try to printf() the board_id as an unsigned int
1:12:20Run our program to see some output
1:12:20Run our program to see some output
1:12:20Run our program to see some output
1:13:16Try to printf() the board_id as a char, cast to an int
1:13:16Try to printf() the board_id as a char, cast to an int
1:13:16Try to printf() the board_id as a char, cast to an int
1:14:20Run the program and hit a trap
1:14:20Run the program and hit a trap
1:14:20Run the program and hit a trap
1:15:06hossein1387 It's a trap!
1:15:06hossein1387 It's a trap!
1:15:06hossein1387 It's a trap!
1:15:11Try to print the board_id as an int, cast to an int
1:15:11Try to print the board_id as an int, cast to an int
1:15:11Try to print the board_id as an int, cast to an int
1:15:45Run the program and hit a trap again
1:15:45Run the program and hit a trap again
1:15:45Run the program and hit a trap again
1:16:39That's all that we have time for for today
1:16:39That's all that we have time for for today
1:16:39That's all that we have time for for today
1:16:53hossein1387 I tried to setup gdb for the board, but I got my OpenOCD all screwed up. I think gdb is very useful in these situations
1:16:53hossein1387 I tried to setup gdb for the board, but I got my OpenOCD all screwed up. I think gdb is very useful in these situations
1:16:53hossein1387 I tried to setup gdb for the board, but I got my OpenOCD all screwed up. I think gdb is very useful in these situations
1:18:41Stay RISCY, everyone!
1:18:41Stay RISCY, everyone!
1:18:41Stay RISCY, everyone!