added streams stop-start after changing of th working mode of blackfin software. It is nessesary because of problems with buffers and hdma queue (maybe)

This commit is contained in:
2025-10-02 19:12:50 +03:00
parent fdcce2ca58
commit c0bc702c24
2 changed files with 18 additions and 6 deletions

Binary file not shown.

24
main.c
View File

@ -854,6 +854,11 @@ uint32_t X502_FlushRcv_buff(t_x502_hnd hnd){
void receive_to_file(t_x502_hnd hnd, char* logfilename, uint32_t* inp_buff, uint32_t max_total_words){ void receive_to_file(t_x502_hnd hnd, char* logfilename, uint32_t* inp_buff, uint32_t max_total_words){
FILE* logfile_ptr = fopen(logfilename, "a"); FILE* logfile_ptr = fopen(logfilename, "a");
// fprintf(logfile_ptr, "0xFF00000 \n");
// fprintf(logfile_ptr, "0xFFFFFFF \n");
// fprintf(logfile_ptr, "0xFF00000 \n");
uint32_t recv_Err_code = X502_Recv(hnd, inp_buff, max_total_words, 10000); uint32_t recv_Err_code = X502_Recv(hnd, inp_buff, max_total_words, 10000);
if (recv_Err_code > 0){ if (recv_Err_code > 0){
uint32_t received_words = recv_Err_code; uint32_t received_words = recv_Err_code;
@ -1268,24 +1273,29 @@ int main(int argc, char** argv) {
printf("\nStart SEMITRANSPARENT mode\n"); // printf("\nStart SEMITRANSPARENT mode\n");
BF_exec_cmd_simple(hnd, 0x800B, 2, 1); //start SEMITRANSPARENT // BF_exec_cmd_simple(hnd, 0x800B, 2, 1); //start SEMITRANSPARENT
// printf("\nStart AVG mode\n"); printf("\nStart AVG mode\n");
// BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging
// printf("\nflush TX buff. \n Number of free TX descriptors before flushing:"); // printf("\nflush TX buff. \n Number of free TX descriptors before flushing:");
// BF_exec_cmd_simple(hnd, 0x8010, 10, 1); // BF_exec_cmd_simple(hnd, 0x8010, 10, 1);
// X502_StreamsStop(hnd); X502_StreamsStop(hnd);
// X502_StreamsStart(hnd); X502_StreamsStart(hnd);
//BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging //BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging
//BF_exec_cmd_simple(hnd, 0x8007, 2, 1); //start transparent //BF_exec_cmd_simple(hnd, 0x8007, 2, 1); //start transparent
// printf("waiting a bit...\n");
// for(uint32_t wait_i = 1e4; wait_i; --wait_i){printf("");}
// for(uint32_t wait_i = 1e6; wait_i; --wait_i){;}
printf("\nFlushed from receiving buff: %d\n", X502_FlushRcv_buff(hnd)); printf("\nFlushed from receiving buff: %d\n", X502_FlushRcv_buff(hnd));
@ -1357,6 +1367,8 @@ int main(int argc, char** argv) {
printf("\nStart transparent mode\n"); printf("\nStart transparent mode\n");
BF_exec_cmd_simple(hnd, 0x8007, 2, 1); //start transparent BF_exec_cmd_simple(hnd, 0x8007, 2, 1); //start transparent
X502_StreamsStop(hnd);
X502_StreamsStart(hnd);
printf("\nflush TX buff. \n Number of free TX descriptors before flushing:"); printf("\nflush TX buff. \n Number of free TX descriptors before flushing:");
BF_exec_cmd_simple(hnd, 0x8010, 10, 1); BF_exec_cmd_simple(hnd, 0x8010, 10, 1);