I should explain that this code was written and debugged by someone a lot smarter than me
- so I know it works. He used professional development tools, but is supportive of my attempt to move it to the Arduino IDE to encourage experimentation by those like me who are more comfortable in that environment. I've had decent success in doing this before, buy may easily be overlooking something. Some things have to be done differently - for example, I had to use pioasm (same result with both cli and online versions) to create the pio.h file. That said:
I do not find stream_bits_program_init() in the stream_bits.pio.h file. However I checked two other pio files that I've used and which compile OK and the equivalent "program.init()" is not present in either of those files either. I'll dig into the docs and try to understand this better. Meanwhile, here is the entire error message, which indeed includes the same error on "program_init":
C:\Users\ranic\Documents\Arduino\RN_translation_freq_generator\RN_translation_freq_generator.ino: In function 'void nco_start(double)':
RN_translation_freq_generator:97:39: error: 'stream_bits_program' was not declared in this scope
97 | uint offset = pio_add_program(pio, &stream_bits_program);
| ^~~~~~~~~~~~~~~~~~~
RN_translation_freq_generator
3: error: 'stream_bits_program_init' was not declared in this scope
100 | stream_bits_program_init(pio, sm, offset, 0); // GPIO0
| ^~~~~~~~~~~~~~~~~~~~~~~~
exit status 1
'stream_bits_program' was not declared in this scope
Thanks for your reply.

I do not find stream_bits_program_init() in the stream_bits.pio.h file. However I checked two other pio files that I've used and which compile OK and the equivalent "program.init()" is not present in either of those files either. I'll dig into the docs and try to understand this better. Meanwhile, here is the entire error message, which indeed includes the same error on "program_init":
C:\Users\ranic\Documents\Arduino\RN_translation_freq_generator\RN_translation_freq_generator.ino: In function 'void nco_start(double)':
RN_translation_freq_generator:97:39: error: 'stream_bits_program' was not declared in this scope
97 | uint offset = pio_add_program(pio, &stream_bits_program);
| ^~~~~~~~~~~~~~~~~~~
RN_translation_freq_generator
100 | stream_bits_program_init(pio, sm, offset, 0); // GPIO0
| ^~~~~~~~~~~~~~~~~~~~~~~~
exit status 1
'stream_bits_program' was not declared in this scope
Thanks for your reply.
Statistics: Posted by W9RAN — Sun Jan 21, 2024 10:32 pm